localtime java

Solutions on MaxInterview for localtime java by the best coders in the world

showing results for - "localtime java"
Sara
30 May 2018
1import java.time.LocalTime;  
2public class LocalTimeExample1 {  
3  public static void main(String[] args) {  
4    LocalTime time = LocalTime.now();  
5    System.out.println(time);  
6  }  
7}  
Giacomo
06 Apr 2017
1import java.time.LocalTime;  
2public class LocalTimeExample4 {  
3  public static void main(String[] args) {  
4    LocalTime time1 = LocalTime.of(10,43,12);  
5    System.out.println(time1);  
6    LocalTime time2=time1.plusHours(4);  
7    LocalTime time3=time2.plusMinutes(18);  
8    System.out.println(time3);  
9  }  
10}