Get time in milliseconds using Java Calendar : Timing « Development Class « Java






Get time in milliseconds using Java Calendar

   

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());

  }

}

   
    
    
  








Related examples in the same category

1.Compute and display elapsed time of an operation
2.Get system time using System class
3.Class for program event timing
4.Get elapsed time in milliseconds
5.Get elapsed time in seconds
6.Get elapsed time in minutes
7.Get elapsed time in hours
8.Get elapsed time in days
9.java.util.concurrent.TimeUnit: convert between milliseconds and days
10.Get seconds since