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.minusSeconds(1200); System.out.println(d);// w w w . j a va 2 s. c om }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); OffsetDateTime d = o.plus(Period.ofDays(2)); System.out.println(d);// w ww. java 2 s . com }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); LocalTime l = o.toLocalTime(); System.out.println(l); }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); LocalDate l = o.toLocalDate(); System.out.println(l); }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); DayOfWeek l = o.getDayOfWeek(); System.out.println(l); }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); OffsetDateTime d = o.with(LocalDate.now()); System.out.println(d);// ww 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(); OffsetDateTime l = o.withOffsetSameLocal(ZoneOffset.UTC); System.out.println(l);// ww w . j av a2s . c om }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); OffsetDateTime l = o.withOffsetSameInstant(ZoneOffset.UTC); System.out.println(l);/*from w w w . j a v a2s .com*/ }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); LocalDateTime l = o.toLocalDateTime(); System.out.println(l);/*from w w w . ja va 2 s . c o m*/ }
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); OffsetDateTime d = o.plus(20, ChronoUnit.HOURS); System.out.println(d);/*from w w w .j a v a 2s . com*/ }