1// gets total number of milliseconds since the UNIX Epoch
2long totalMilliseconds = System.currentTimeMillis();
3
4long totalSeconds = totalMilliseconds / 1000;
5long currentSeconds = totalSeconds % 60;
6
7long totalMinutes = totalSeconds / 60;
8long currentMinutes = totalMinutes % 60;
9
10long totalHours = totalMinutes / 60;
11long currentHours = totalHours % 24;
12
13// first function call MUST be long
14// current times don't have to be long, can be {int, double, etc...}
15// total times should usually be long
1// gets total number of milliseconds since the UNIX Epoch
2long totalMilliseconds = System.currentTimeMillis();
3
4long totalSeconds = totalMilliseconds / 1000;
5long currentSeconds = totalSeconds % 60;
6
7long totalMinutes = totalSeconds / 60;
8long currentMinutes = totalMinutes % 60;
9
10long totalHours = totalMinutes / 60;
11long currentHours = totalHours % 24;
12
13// first function call MUST be long
14// current times don't have to be long, can be {int, double, etc...}
15// total times should usually be long
16