Created
February 17, 2016 20:32
-
-
Save ilyaBrandon/4c6c299663962113d8c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
// we must calculate how many D:H:M:S from 1 January 1970 to today | |
long time = System.currentTimeMillis()/1000; | |
int day = (int) time / (60 * 60 * 24); | |
time = time % (60 * 60 * 24); | |
int hour = (int) time / (60 * 60); | |
time = time % (60 * 60); | |
int min = (int) time / 60; | |
time = time % 60; | |
int sec = (int) time; | |
System.out.print(day + ":" + hour + ":"+ min + ":" + sec); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment