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(); LocalTime l = dateTime.toLocalTime(); System.out.println(l);//from ww w . jav a 2s . c o m }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); LocalDate l = dateTime.toLocalDate(); System.out.println(l);//from www . j a v a 2 s .com }
From source file:Main.java
public static void main(String[] args) { Instant instant = Instant.from(ZonedDateTime.now()); System.out.println(instant.getEpochSecond()); }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); LocalDateTime l = dateTime.toLocalDateTime(); System.out.println(l);/*from w ww. jav a 2s .c o m*/ }
From source file:Main.java
public static void main(String[] args) { ZoneOffset t = ZoneOffset.from(ZonedDateTime.now()); System.out.println(t); }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); OffsetDateTime o = dateTime.toOffsetDateTime(); System.out.println(o);// ww w . j a va 2 s .c om }
From source file:Main.java
public static void main(String[] args) { System.out.println(toTimestamp(ZonedDateTime.now())); }
From source file:Main.java
public static void main(String[] args) { OffsetTime m = OffsetTime.from(ZonedDateTime.now()); System.out.println(m); }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); System.out.println(dateTime.isSupported(ChronoUnit.YEARS)); }
From source file:Main.java
public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.now(); ZonedDateTime n = dateTime.truncatedTo(ChronoUnit.YEARS); System.out.println(n);//w w w . j a v a 2s . c o m }