List of usage examples for java.time OffsetDateTime now
public static OffsetDateTime now()
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); OffsetDateTime d = o.truncatedTo(ChronoUnit.DAYS); System.out.println(d);//from w w w.j a va 2s. c o m }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); boolean l = o.isSupported(ChronoUnit.DAYS); System.out.println(l);//from w ww . j a v a 2 s . com }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); OffsetDateTime d = o.minus(20, ChronoUnit.HOURS); System.out.println(d);/*from w w w . j a v a2 s. c o m*/ }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); long l = o.getLong(ChronoField.DAY_OF_WEEK); System.out.println(l);//w ww . jav a 2s .co m }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); boolean l = o.isSupported(ChronoField.DAY_OF_WEEK); System.out.println(l);//from w ww . j a v a 2 s.c om }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); OffsetDateTime d = o.with(ChronoField.YEAR, 2010); System.out.println(d);/*w w w.j a v a 2 s. c o m*/ }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); int l = o.get(ChronoField.DAY_OF_WEEK); System.out.println(l);/* w w w.ja v a 2s .c o m*/ }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); String l = o.format(DateTimeFormatter.ISO_DATE_TIME); System.out.println(l);// w w w.j ava 2 s .co m }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); ZonedDateTime d = o.atZoneSimilarLocal(ZoneId.systemDefault()); System.out.println(d);//from w w w . ja v a 2 s .c om }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); ZonedDateTime d = o.atZoneSameInstant(ZoneId.systemDefault()); System.out.println(d);//w ww. j a v a 2 s .co m }