Get system time using System class - Java Java Virtual Machine

Java examples for Java Virtual Machine:Utility

Description

Get system time using System class

Demo Code


public class Main {

  public static void main(String[] args) {

    long lnSystemTime = System.currentTimeMillis();

    System.out.println("Milliseconds since midnight, January 1, 1970 UTC : " + lnSystemTime);
  }//from   w w  w . ja v  a  2s. co  m
}

Result


Related Tutorials