- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise14.java
More file actions
Latest commit
16 lines (13 loc) · 688 Bytes
/
Copy pathExercise14.java
File metadata and controls
16 lines (13 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
publicclassExercise14 {
publicstaticvoidmain(Stringarg[]) {
// Write a program that prints out approximately how many days it has been
// since midnight on January 1, 1970. For this question, make
// use of the System.currentTimeMillis() function in Java which
// will give you the number of milliseconds since midnight on
// January 1, 1970.
longn = System.currentTimeMillis();
System.out.println("It has been " + n + " milliseconds since midnight Jan 1, 1970.");
longdays = ...; // add your code here, then click "run" to test it.
System.out.println("That is " + days + " days ago!");
}
}