all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
11
Task/System-time/Java/system-time-2.java
Normal file
11
Task/System-time/Java/system-time-2.java
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import java.util.Date;
|
||||
|
||||
public class SystemTime{
|
||||
public static void main(String[] args){
|
||||
Date now = new Date();
|
||||
System.out.println(now); // string representation
|
||||
|
||||
System.out.println(now.getTime()); // Unix time (# of milliseconds since Jan 1 1970)
|
||||
//System.currentTimeMillis() returns the same value
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue