Get system time using System class : Timing « Development Class « Java

Get system time using System class


public class Main {

  public static void main(String[] args) {
    long lnSystemTime = System.currentTimeMillis();
    System.out.println("Milliseconds since midnight, January 1, 1970 UTC : " + lnSystemTime);


Related examples in the same category

1.Compute and display elapsed time of an operation
2.Class for program event timing
3.Get elapsed time in milliseconds
4.Get elapsed time in seconds
5.Get elapsed time in minutes
6.Get elapsed time in hours
7.Get elapsed time in days
8.Get time in milliseconds using Java Calendar convert between milliseconds and days
10.Get seconds since