Example usage for java.util Calendar getInstance

List of usage examples for java.util Calendar getInstance

Introduction

In this page you can find the example usage for java.util Calendar getInstance.

Prototype

public static Calendar getInstance(TimeZone zone, Locale aLocale) 

Source Link

Document

Gets a calendar with the specified time zone and locale.

Usage

From source file:Main.java

public static void main(String[] args) {

    // create a calendar
    Locale locale1 = Locale.CANADA;
    TimeZone tz1 = TimeZone.getTimeZone("GMT");
    Calendar cal1 = Calendar.getInstance(tz1, locale1);

    // display time zone for both calendars
    String tzname1 = tz1.getDisplayName();
    String name1 = locale1.getDisplayName();
    System.out.println("GMT and Canada: " + tzname1 + " " + name1);
}