List of usage examples for java.time LocalTime now
public static LocalTime now()
From source file:Main.java
public static void main(String[] args) { System.out.println(toLocalTime(java.sql.Time.valueOf(LocalTime.now()))); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); String s = l.format(DateTimeFormatter.ISO_LOCAL_TIME); System.out.println(s);/*w w w .ja v a 2 s. co m*/ }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.query(TemporalQueries.localTime()); System.out.println(s);/* w w w .jav a2 s.c om*/ }
From source file:Main.java
public static void main(String[] args) { // current/*from w w w . j a va2 s .c om*/ LocalTime localTime1 = LocalTime.now(); System.out.println(localTime1); // 09:30 LocalTime localTime2 = LocalTime.of(9, 30); System.out.println(localTime2); // 09:30:50 LocalTime localTime3 = LocalTime.of(9, 30, 50); System.out.println(localTime3); // 09:30:50.000005678 LocalTime localTime4 = LocalTime.of(9, 30, 50, 5678); System.out.println(localTime4); }
From source file:Main.java
public static void main(String[] args) { LocalTime d = LocalTime.now(); DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm"); System.out.println(TIME_FORMATTER.format(d)); }
From source file:Main.java
public static void main(String[] args) { LocalTime d = LocalTime.now(); DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("H:m"); System.out.println(TIME_FORMATTER.format(d)); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); OffsetTime t = l.atOffset(ZoneOffset.UTC); System.out.println(t);/* ww w . j a v a2s . c o m*/ }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalDateTime t = l.atDate(LocalDate.now()); System.out.println(t);//from w w w . j a va 2s . c o m }
From source file:Main.java
public static void main(String[] args) { OffsetTime m = OffsetTime.of(LocalTime.now(), ZoneOffset.UTC); System.out.println(m); }
From source file:Main.java
public static void main(String[] argv) { LocalDate today = LocalDate.now(); LocalTime time = LocalTime.now(); LocalDateTime timeWithDate = LocalDateTime.now(); System.out.println("today = " + today); System.out.println("local date with time now = " + timeWithDate); System.out.println("time = " + time); }