Views: 183
Java's java.lang.System
Class has method currentTimeMillis()
method which gives you the How to get current time in milliseconds.
public class GetCurrentMilliseconds {
public static void main(String[] args) {
long currentTimeInMillies = System.currentTimeMillis();
System.out.println("Current time in millies:" + currentTimeInMillies);
}
}
Interesting Fact:
The milliseconds what you see are the difference measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
On By
FastFoodCoding
Top Tutorials
71165
16048
10026
10009
7058
3443
1568
1548
1387
997
Top Questions
5677
4208
2961
2455
1803
1522
1390
1332
1232
1157
Top Articles
897
767
357