Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class MyTime {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- Date d = new Date(long );
- long number = input.nextLong();
- long totalMilliseconds = System.currentTimeMillis();
- long totalSeconds = totalMilliseconds/1000;
- long currentSecond = totalSeconds % 60;
- long totalMinutes = totalSeconds/60;
- long currentMinute = totalMinutes % 60;
- long totalHours = totalMinutes/60;
- long currentHour = totalHours % 24;
- System.out.println( d+ ":" +currentHour+ ":" +currentMinute+ ":" +currentSecond+ " GMT");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement