Name

GregorianCalendar

Synopsis

This concrete subclass of Calendar implements the standard solar calendar with years numbered from the birth of Christ that is used is most locales throughout the world. You do not typically use this class directly, but instead obtain a Calendar object suitable for the default locale by calling Calendar.getInstance( ). See Calendar for details on working with Calendar objects. There is a discontinuity in the Gregorian calendar that represents the historical switch from the Julian calendar to the Gregorian calendar. By default, GregorianCalendar assumes that this switch occurs on October 15, 1582. Most programs need not be concerned with the switch.

java.util.GregorianCalendar

Figure 16-23. java.util.GregorianCalendar

public class GregorianCalendar extends Calendar {
// Public Constructors
     public GregorianCalendar( );  
     public GregorianCalendar(Locale aLocale);  
     public GregorianCalendar(TimeZone zone);  
     public GregorianCalendar(TimeZone zone, Locale aLocale);  
     public GregorianCalendar(int year, int month, int dayOfMonth);  
     public GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, 
        int minute);  
     public GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute, 
        int second);  
// Public Constants
     public static final int AD;                                         =1
     public static final int BC;                                         =0
                  // Public Instance Methods
     public final Date getGregorianChange( );  
     public boolean isLeapYear ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.