List of usage examples for java.time LocalTime now
public static LocalTime now()
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.compareTo(LocalTime.NOON)); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.isBefore(LocalTime.NOON)); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.withHour(4); System.out.println(s); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.getNano()); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.plusSeconds(1234); System.out.println(s); }
From source file:Main.java
public static void main(String[] args) { System.out.println(toSqlTime(LocalTime.now())); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.minus(Period.ofDays(1)); System.out.println(s); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.plus(Duration.ofHours(1)); System.out.println(s);//w w w. ja v a 2s .c o m }
From source file:Main.java
public static void main(String[] args) { LocalTime currentTime = LocalTime.now(); // current time System.out.println(currentTime); LocalTime midday = LocalTime.of(12, 0); // 12:00 System.out.println(midday); // 12:00 LocalTime afterMidday = LocalTime.of(13, 30, 15); // 13:30:15 System.out.println(afterMidday); // 13:30:15 // 12345th second of day (03:25:45) LocalTime fromSecondsOfDay = LocalTime.ofSecondOfDay(12345); System.out.println(fromSecondsOfDay); // 03:25:45 }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime t = LocalTime.NOON; Temporal s = l.adjustInto(t); System.out.println(s);/*from ww w . j a va 2s. com*/ }