FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 300   



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


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News