Java LocalDate format using DateTimeFormatter.ISO_DATE

Description

Java LocalDate format using DateTimeFormatter.ISO_DATE

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Main {
  public static void main(String[] args) {
    LocalDate ld = LocalDate.now();
    String ldStr = ld.format(DateTimeFormatter.ISO_DATE);
    System.out.println("Local Date: " + ldStr);

  }//from   w w  w .j ava  2  s.  c o m
}



PreviousNext

Related