Java ZonedDateTime format using DateTimeFormatter.ISO_DATE

Description

Java ZonedDateTime format using DateTimeFormatter.ISO_DATE

import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class Main {
  public static void main(String[] args) {
    ZonedDateTime zdt = ZonedDateTime.now();
    String zdtStr = zdt.format(DateTimeFormatter.ISO_DATE);
    System.out.println("Zoned Datetime: " + zdtStr);

  }/*from ww  w. j a v a 2 s .c o m*/
}



PreviousNext

Related