Java GregorianCalendar(TimeZone zone, Locale aLocale) Constructor

Syntax

GregorianCalendar(TimeZone zone, Locale aLocale) constructor from GregorianCalendar has the following syntax.

public GregorianCalendar(TimeZone zone,     Locale aLocale)

Example

In the following code shows how to use GregorianCalendar.GregorianCalendar(TimeZone zone, Locale aLocale) constructor.


//  w  w  w  . j  a v a 2s  . co m
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;

public class Main {

   public static void main(String[] args) {

      GregorianCalendar cal = new GregorianCalendar(TimeZone.getDefault(),Locale.getDefault());

      System.out.println(cal.getTime());
      

   }
}

The code above generates the following result.