Get time in milliseconds using Calendar - Java Date Time

Java examples for Date Time:Calendar

Description

Get time in milliseconds using Calendar

Demo Code


import java.util.Calendar;
 
public class Main {
 
  public static void main(String[] args) {
    Calendar now = Calendar.getInstance();
    System.out.println("Current milliseconds since Jan 1, 1970 are :"
                  + now.getTimeInMillis());
  }/* w  ww .j  a  v a2 s .  c  o m*/
}

Result


Related Tutorials