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(); LocalTime s = l.truncatedTo(ChronoUnit.HOURS); System.out.println(s);//from w w w . j a v a 2 s . c o m }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.minus(1000, ChronoUnit.SECONDS); System.out.println(s);//from w ww .j av a 2s. c o m }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.plus(14, ChronoUnit.MINUTES); System.out.println(s);/*ww w . j av a2 s. co m*/ }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); long s = l.until(LocalTime.NOON, ChronoUnit.HOURS); System.out.println(s);/* ww w . j a v a 2 s. c om*/ }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.isSupported(ChronoUnit.MINUTES)); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.isSupported(ChronoField.MICRO_OF_SECOND)); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.with(ChronoField.HOUR_OF_DAY, 4); System.out.println(s);//from w w w. j a va 2 s . co m }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.get(ChronoField.MINUTE_OF_HOUR)); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.getLong(ChronoField.MINUTE_OF_HOUR)); }
From source file:Main.java
public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.range(ChronoField.MINUTE_OF_HOUR)); }