ICU 77.1  77.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
icu::GregorianCalendar Class Reference

Concrete class which provides the standard calendar used by most of the world. More...

#include <gregocal.h>

Inheritance diagram for icu::GregorianCalendar:
icu::Calendar icu::UObject icu::UMemory

Public Types

enum  EEras { BC , AD }
 Useful constants for GregorianCalendar and TimeZone. More...
 
- Public Types inherited from icu::Calendar
enum  EDateFields {
  ERA , YEAR , MONTH , WEEK_OF_YEAR ,
  WEEK_OF_MONTH , DATE , DAY_OF_YEAR , DAY_OF_WEEK ,
  DAY_OF_WEEK_IN_MONTH , AM_PM , HOUR , HOUR_OF_DAY ,
  MINUTE , SECOND , MILLISECOND , ZONE_OFFSET ,
  DST_OFFSET , YEAR_WOY , DOW_LOCAL , EXTENDED_YEAR ,
  JULIAN_DAY , MILLISECONDS_IN_DAY , IS_LEAP_MONTH , FIELD_COUNT = UCAL_FIELD_COUNT
}
 Field IDs for date and time. More...
 
enum  EDaysOfWeek {
  SUNDAY = 1 , MONDAY , TUESDAY , WEDNESDAY ,
  THURSDAY , FRIDAY , SATURDAY
}
 Useful constant for days of week. More...
 
enum  EMonths {
  JANUARY , FEBRUARY , MARCH , APRIL ,
  MAY , JUNE , JULY , AUGUST ,
  SEPTEMBER , OCTOBER , NOVEMBER , DECEMBER ,
  UNDECIMBER
}
 Useful constants for month. More...
 
enum  EAmpm { AM , PM }
 Useful constants for hour in 12-hour clock. More...
 

Public Member Functions

 GregorianCalendar (UErrorCode &success)
 Constructs a default GregorianCalendar using the current time in the default time zone with the default locale. More...
 
 GregorianCalendar (TimeZone *zoneToAdopt, UErrorCode &success)
 Constructs a GregorianCalendar based on the current time in the given time zone with the default locale. More...
 
 GregorianCalendar (const TimeZone &zone, UErrorCode &success)
 Constructs a GregorianCalendar based on the current time in the given time zone with the default locale. More...
 
 GregorianCalendar (const Locale &aLocale, UErrorCode &success)
 Constructs a GregorianCalendar based on the current time in the default time zone with the given locale. More...
 
 GregorianCalendar (TimeZone *zoneToAdopt, const Locale &aLocale, UErrorCode &success)
 Constructs a GregorianCalendar based on the current time in the given time zone with the given locale. More...
 
 GregorianCalendar (const TimeZone &zone, const Locale &aLocale, UErrorCode &success)
 Constructs a GregorianCalendar based on the current time in the given time zone with the given locale. More...
 
 GregorianCalendar (int32_t year, int32_t month, int32_t date, UErrorCode &success)
 Constructs a GregorianCalendar with the given AD date set in the default time zone with the default locale. More...
 
 GregorianCalendar (int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, UErrorCode &success)
 Constructs a GregorianCalendar with the given AD date and time set for the default time zone with the default locale. More...
 
 GregorianCalendar (int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode &success)
 Constructs a GregorianCalendar with the given AD date and time set for the default time zone with the default locale. More...
 
virtual ~GregorianCalendar ()
 Destructor. More...
 
 GregorianCalendar (const GregorianCalendar &source)
 Copy constructor. More...
 
GregorianCalendaroperator= (const GregorianCalendar &right)
 Default assignment operator. More...
 
virtual GregorianCalendarclone () const override
 Create and return a polymorphic copy of this calendar. More...
 
void setGregorianChange (UDate date, UErrorCode &success)
 Sets the GregorianCalendar change date. More...
 
UDate getGregorianChange () const
 Gets the Gregorian Calendar change date. More...
 
UBool isLeapYear (int32_t year) const
 Return true if the given year is a leap year. More...
 
virtual UBool isEquivalentTo (const Calendar &other) const override
 Returns true if the given Calendar object is equivalent to this one. More...
 
virtual void roll (EDateFields field, int32_t amount, UErrorCode &status) override
 (Overrides Calendar) Rolls up or down by the given amount in the specified field. More...
 
virtual void roll (UCalendarDateFields field, int32_t amount, UErrorCode &status) override
 (Overrides Calendar) Rolls up or down by the given amount in the specified field. More...
 
int32_t getActualMinimum (EDateFields field) const
 Return the minimum value that this field could have, given the current date. More...
 
int32_t getActualMinimum (EDateFields field, UErrorCode &status) const
 Return the minimum value that this field could have, given the current date. More...
 
int32_t getActualMinimum (UCalendarDateFields field, UErrorCode &status) const override
 Return the minimum value that this field could have, given the current date. More...
 
virtual int32_t getActualMaximum (UCalendarDateFields field, UErrorCode &status) const override
 Return the maximum value that this field could have, given the current date. More...
 
virtual UClassID getDynamicClassID () const override
 Override Calendar Returns a unique class ID POLYMORPHICALLY. More...
 
virtual const char * getType () const override
 Returns the calendar type name string for this Calendar object. More...
 
- Public Member Functions inherited from icu::Calendar
virtual ~Calendar ()
 destructor More...
 
UDate getTime (UErrorCode &status) const
 Gets this Calendar's time as milliseconds. More...
 
void setTime (UDate date, UErrorCode &status)
 Sets this Calendar's current time with the given UDate. More...
 
virtual bool operator== (const Calendar &that) const
 Compares the equality of two Calendar objects. More...
 
bool operator!= (const Calendar &that) const
 Compares the inequality of two Calendar objects. More...
 
UBool equals (const Calendar &when, UErrorCode &status) const
 Compares the Calendar time, whereas Calendar::operator== compares the equality of Calendar objects. More...
 
UBool