Calendar class setTimeInMillis(long millis) method example
Calendar class setTimeInMillis(long millis) method example. This example shows you how to use setTimeInMillis(long millis) method.This method Sets this Calendar's current time from the given long value.
Here is the code:-
/**
* @Program that Sets this Calendar's current time from the given long value. * locale.
* setTimeInMillisCalendar.java
* Author:-RoseIndia Team
* Date:-22-May-2008
*/
import java.util.*;
public class setTimeInMillisCalendar {
public static void main(String[] args) {
Calendar c=Calendar.getInstance();
// Sets this Calendar's current time from the given long value.
System.out.println("The time in milliseconds is: "+c.getTimeInMillis());
}
} |
Output of the program:-
| The time in milliseconds is: 1211462861007 |
|