The currentTimeMillis() method returns the current time in milliseconds since 00:00:00,January I, 1970.This method is used to know the time interval a process or job takes to perform. We record the time before and after the operation and the difference of two timings tells us the total time the operation took.
public class currentTimeMillisExample
public static void main( String args)
long t = System.currentTimeMillis();
Date today = new Date(t);
Calendar cal = Calendar.getInstance();
today = cal.getTime();