List of usage examples for java.time ZonedDateTime now
public static ZonedDateTime now()
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); ZonedDateTime n = dateTime.plusHours(1234); System.out.println(n);/*from ww w.ja va 2 s . co m*/ }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); ZonedDateTime n = dateTime.withNano(1234); System.out.println(n);/* www. jav a 2 s .c om*/ }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); dateTime = dateTime.withMonth(2);//from w ww . j a va 2 s.c o m System.out.println(dateTime); }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime currentTime = ZonedDateTime.now(); System.out.printf("%tA %<tB %<te, %<tY %n", currentTime); System.out.printf("%TA %<TB %<te, %<tY %n", currentTime); System.out.printf("%tD %n", currentTime); System.out.printf("%tF %n", currentTime); System.out.printf("%tc %n", currentTime); System.out.printf("%Tc %n", currentTime); }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.from(ZonedDateTime.now()); System.out.println(dateTime); }
From source file:Main.java
public static void main(String[] args) { ZoneId z = ZoneId.from(ZonedDateTime.now()); System.out.println(z); }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); ZonedDateTime l = dateTime.withZoneSameInstant(ZoneId.systemDefault()); System.out.println(l);/*from w w w .j a v a 2 s. co m*/ }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); ZonedDateTime n = dateTime.minus(Period.ofDays(12)); System.out.println(n);// ww w .j a v a2s . c om }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); ZonedDateTime n = dateTime.plus(Period.ofYears(12)); System.out.println(n);/*w ww . j a v a 2 s.c o m*/ }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); ZonedDateTime l = dateTime.withZoneSameLocal(ZoneId.systemDefault()); System.out.println(l);//from w w w .java 2 s . c om }