Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Tra {
- public static void main(String[] args) {
- long seconds = (System.currentTimeMillis()/100);
- long minutes = seconds / 60;
- long hours = minutes / 60;
- long days = hours / 24;
- long time = System.currentTimeMillis();
- long days1 = time / (1000 * 60 * 60 * 24);
- long rest = time % (1000 * 60 * 60 * 24);
- long hours1 = rest / (1000 * 60 * 60);
- rest %= (1000 * 60 * 60);
- long minutes1 = rest / (1000 * 60);
- rest %= (1000 * 60);
- long seconds1 = rest / 1000;
- System.out.println(days1 + " : " + hours1 + " : " + minutes1 + " : " + seconds1);
- System.out.print(days + ":");
- System.out.print(hours + ":");
- System.out.print(minutes+ ":");
- System.out.print(seconds);
- // так як завдання не повністю зрозуміле, довелось його виконати в двох варіаціях :)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement