Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import java.util.*;
  2.  
  3.  
  4.  
  5. public class MyTime {
  6.  
  7.  
  8.  
  9.  
  10. public static void main(String[] args) {
  11. Scanner input = new Scanner(System.in);
  12. Date d = new Date(long );
  13. long number = input.nextLong();
  14. long totalMilliseconds = System.currentTimeMillis();
  15. long totalSeconds = totalMilliseconds/1000;
  16. long currentSecond = totalSeconds % 60;
  17. long totalMinutes = totalSeconds/60;
  18. long currentMinute = totalMinutes % 60;
  19. long totalHours = totalMinutes/60;
  20. long currentHour = totalHours % 24;
  21. System.out.println( d+ ":" +currentHour+ ":" +currentMinute+ ":" +currentSecond+ " GMT");
  22. }
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement