Calendar class getInstance(TimeZone zone) method example
Calendar class getInstance(TimeZone zone) method example. This example shows you how to use getInstance(TimeZone zone) method.This method Gets a calendar using the specified time zone and default locale.
Here is the code:-
/**
* @Program that Gets a calendar using the specified time zone and default
* locale.
* getInstance2calender.java
* Author:-RoseIndia Team
* Date:-22-May-2008
*/
import java.util.*;
public class getInstance2calender {
public static void main(String[] args) {
Calendar c=Calendar.getInstance();
//creating time zone
TimeZone tz=c.getTimeZone();
// Gets a calendar using the specified time zone and default locale.
System.out.println(tz.getDisplayName());
}
} |
|