Calendar

Undocumented in source.
abstract
class Calendar : Cloneable, Comparable!(Calendar) {}

Members

Static functions

getInstance
Calendar getInstance(TimeZone zone)

Gets a calendar using the specified time zone and default locale. The <code>Calendar</code> returned is based on the current time in the given time zone with the default {@link LocaleCategory#FORMAT FORMAT} locale.

getInstance
Calendar getInstance(Locale aLocale)

Gets a calendar using the default time zone and specified locale. The <code>Calendar</code> returned is based on the current time in the default time zone with the given locale. <p> If the locale contains the time zone with "tz" <a href="Locale.html#def_locale_extension">Unicode extension</a>, that time zone is used instead.

getInstance
Calendar getInstance()

Gets a calendar using the default time zone and locale. The <code>Calendar</code> returned is based on the current time in the default time zone with the default {@link LocaleCategory#FORMAT FORMAT} locale. <p> If the locale contains the time zone with "tz" <a href="Locale.html#def_locale_extension">Unicode extension</a>, that time zone is used instead.

getInstance
Calendar getInstance(TimeZone zone, Locale aLocale)

Gets a calendar with the specified time zone and locale. The <code>Calendar</code> returned is based on the current time in the given time zone with the given locale.

Variables

ALL_FIELDS
enum int ALL_FIELDS;

The mask value that represents all of the fields.

ALL_STYLES
enum int ALL_STYLES;

A style specifier for {@link #getDisplayNames(int, int, Locale) getDisplayNames} indicating names in all styles, such as "January" and "Jan".

AM
enum int AM;

Value of the {@link #AM_PM} field indicating the period of the day from midnight to just before noon.

AM_PM
enum int AM_PM;

Field number for <code>get</code> and <code>set</code> indicating whether the <code>HOUR</code> is before or after noon. E.g., at 10:04:15.250 PM the <code>AM_PM</code> is <code>PM</code>.

AM_PM_MASK
enum int AM_PM_MASK;
Undocumented in source.
APRIL
enum int APRIL;

Value of the {@link #MONTH} field indicating the fourth month of the year in the Gregorian and Julian calendars.

AUGUST
enum int AUGUST;

Value of the {@link #MONTH} field indicating the eighth month of the year in the Gregorian and Julian calendars.

DATE
enum int DATE;

Field number for <code>get</code> and <code>set</code> indicating the day of the month. This is a synonym for <code>DAY_OF_MONTH</code>. The first day of the month has value 1.

DATE_MASK
enum int DATE_MASK;
Undocumented in source.
DAY_OF_MONTH
enum int DAY_OF_MONTH;

Field number for <code>get</code> and <code>set</code> indicating the day of the month. This is a synonym for <code>DATE</code>. The first day of the month has value 1.

DAY_OF_MONTH_MASK
enum int DAY_OF_MONTH_MASK;
Undocumented in source.
DAY_OF_WEEK
enum int DAY_OF_WEEK;

Field number for <code>get</code> and <code>set</code> indicating the day of the week. This field takes values <code>SUNDAY</code>, <code>MONDAY</code>, <code>TUESDAY</code>, <code>WEDNESDAY</code>, <code>THURSDAY</code>, <code>FRIDAY</code>, and <code>SATURDAY</code>.

DAY_OF_WEEK_IN_MONTH
enum int DAY_OF_WEEK_IN_MONTH;

Field number for <code>get</code> and <code>set</code> indicating the ordinal number of the day of the week within the current month. Together with the <code>DAY_OF_WEEK</code> field, this uniquely specifies a day within a month. Unlike <code>WEEK_OF_MONTH</code> and <code>WEEK_OF_YEAR</code>, this field's value does <em>not</em> depend on <code>getFirstDayOfWeek()</code> or <code>getMinimalDaysInFirstWeek()</code>. <code>DAY_OF_MONTH 1</code> through <code>7</code> always correspond to <code>DAY_OF_WEEK_IN_MONTH 1</code>; <code>8</code> through <code>14</code> correspond to <code>DAY_OF_WEEK_IN_MONTH 2</code>, and so on. <code>DAY_OF_WEEK_IN_MONTH 0</code> indicates the week before <code>DAY_OF_WEEK_IN_MONTH 1</code>. Negative values count back from the end of the month, so the last Sunday of a month is specified as <code>DAY_OF_WEEK = SUNDAY, DAY_OF_WEEK_IN_MONTH = -1</code>. Because negative values count backward they will usually be aligned differently within the month than positive values. For example, if a month has 31 days, <code>DAY_OF_WEEK_IN_MONTH -1</code> will overlap <code>DAY_OF_WEEK_IN_MONTH 5</code> and the end of <code>4</code>.

DAY_OF_WEEK_IN_MONTH_MASK
enum int DAY_OF_WEEK_IN_MONTH_MASK;
Undocumented in source.
DAY_OF_WEEK_MASK
enum int DAY_OF_WEEK_MASK;
Undocumented in source.
DAY_OF_YEAR
enum int DAY_OF_YEAR;

Field number for <code>get</code> and <code>set</code> indicating the day number within the current year. The first day of the year has value 1.

DAY_OF_YEAR_MASK
enum int DAY_OF_YEAR_MASK;
Undocumented in source.
DECEMBER
enum int DECEMBER;

Value of the {@link #MONTH} field indicating the twelfth month of the year in the Gregorian and Julian calendars.

DST_OFFSET
enum int DST_OFFSET;

Field number for <code>get</code> and <code>set</code> indicating the daylight saving offset in milliseconds. <p> This field reflects the correct daylight saving offset value of the time zone of this <code>Calendar</code> if the <code>TimeZone</code> implementation subclass supports historical Daylight Saving Time schedule changes.

DST_OFFSET_MASK
enum int DST_OFFSET_MASK;
Undocumented in source.
ERA
enum int ERA;

Field number for <code>get</code> and <code>set</code> indicating the era, e.g., AD or BC in the Julian calendar. This is a calendar-specific value; see subclass documentation.

ERA_MASK
enum int ERA_MASK;
Undocumented in source.
FEBRUARY
enum int FEBRUARY;

Value of the {@link #MONTH} field indicating the second month of the year in the Gregorian and Julian calendars.

FIELD_COUNT
enum int FIELD_COUNT;

The number of distinct fields recognized by <code>get</code> and <code>set</code>. Field numbers range from <code>0..FIELD_COUNT-1</code>.

FRIDAY
enum int FRIDAY;

Value of the {@link #DAY_OF_WEEK} field indicating Friday.

HOUR
enum int HOUR;

Field number for <code>get</code> and <code>set</code> indicating the hour of the morning or afternoon. <code>HOUR</code> is used for the 12-hour clock (0 - 11). Noon and midnight are represented by 0, not by 12. E.g., at 10:04:15.250 PM the <code>HOUR</code> is 10.

HOUR_MASK
enum int HOUR_MASK;
Undocumented in source.
HOUR_OF_DAY
enum int HOUR_OF_DAY;

Field number for <code>get</code> and <code>set</code> indicating the hour of the day. <code>HOUR_OF_DAY</code> is used for the 24-hour clock. E.g., at 10:04:15.250 PM the <code>HOUR_OF_DAY</code> is 22.

HOUR_OF_DAY_MASK
enum int HOUR_OF_DAY_MASK;
Undocumented in source.
JANUARY
enum int JANUARY;

Value of the {@link #MONTH} field indicating the first month of the year in the Gregorian and Julian calendars.

JULY
enum int JULY;

Value of the {@link #MONTH} field indicating the seventh month of the year in the Gregorian and Julian calendars.

JUNE
enum int JUNE;

Value of the {@link #MONTH} field indicating the sixth month of the year in the Gregorian and Julian calendars.

LONG
enum int LONG;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} equivalent to {@link #LONG_FORMAT}.

LONG_FORMAT
enum int LONG_FORMAT;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} indicating a long name used for format.

LONG_STANDALONE
enum int LONG_STANDALONE;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} indicating a long name used independently, such as a month name as calendar headers.

MARCH
enum int MARCH;

Value of the {@link #MONTH} field indicating the third month of the year in the Gregorian and Julian calendars.

MAY
enum int MAY;

Value of the {@link #MONTH} field indicating the fifth month of the year in the Gregorian and Julian calendars.

MILLISECOND
enum int MILLISECOND;

Field number for <code>get</code> and <code>set</code> indicating the millisecond within the second. E.g., at 10:04:15.250 PM the <code>MILLISECOND</code> is 250.

MILLISECOND_MASK
enum int MILLISECOND_MASK;
Undocumented in source.
MINUTE
enum int MINUTE;

Field number for <code>get</code> and <code>set</code> indicating the minute within the hour. E.g., at 10:04:15.250 PM the <code>MINUTE</code> is 4.

MINUTE_MASK
enum int MINUTE_MASK;
Undocumented in source.
MONDAY
enum int MONDAY;

Value of the {@link #DAY_OF_WEEK} field indicating Monday.

MONTH
enum int MONTH;

Field number for <code>get</code> and <code>set</code> indicating the month. This is a calendar-specific value. The first month of the year in the Gregorian and Julian calendars is <code>JANUARY</code> which is 0; the last depends on the number of months in a year.

MONTH_MASK
enum int MONTH_MASK;
Undocumented in source.
NARROW_FORMAT
enum int NARROW_FORMAT;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} indicating a narrow name used for format. Narrow names are typically single character strings, such as "M" for Monday.

NARROW_STANDALONE
enum int NARROW_STANDALONE;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} indicating a narrow name independently. Narrow names are typically single character strings, such as "M" for Monday.

NOVEMBER
enum int NOVEMBER;

Value of the {@link #MONTH} field indicating the eleventh month of the year in the Gregorian and Julian calendars.

OCTOBER
enum int OCTOBER;

Value of the {@link #MONTH} field indicating the tenth month of the year in the Gregorian and Julian calendars.

PM
enum int PM;

Value of the {@link #AM_PM} field indicating the period of the day from noon to just before midnight.

SATURDAY
enum int SATURDAY;

Value of the {@link #DAY_OF_WEEK} field indicating Saturday.

SECOND
enum int SECOND;

Field number for <code>get</code> and <code>set</code> indicating the second within the minute. E.g., at 10:04:15.250 PM the <code>SECOND</code> is 15.

SECOND_MASK
enum int SECOND_MASK;
Undocumented in source.
SEPTEMBER
enum int SEPTEMBER;

Value of the {@link #MONTH} field indicating the ninth month of the year in the Gregorian and Julian calendars.

SHORT
enum int SHORT;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} equivalent to {@link #SHORT_FORMAT}.

SHORT_FORMAT
enum int SHORT_FORMAT;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} indicating a short name used for format.

SHORT_STANDALONE
enum int SHORT_STANDALONE;

A style specifier for {@link #getDisplayName(int, int, Locale) getDisplayName} and {@link #getDisplayNames(int, int, Locale) getDisplayNames} indicating a short name used independently, such as a month abbreviation as calendar headers.

STANDALONE_MASK
enum int STANDALONE_MASK;
Undocumented in source.
SUNDAY
enum int SUNDAY;

Value of the {@link #DAY_OF_WEEK} field indicating Sunday.

THURSDAY
enum int THURSDAY;

Value of the {@link #DAY_OF_WEEK} field indicating Thursday.

TUESDAY
enum int TUESDAY;

Value of the {@link #DAY_OF_WEEK} field indicating Tuesday.

UNDECIMBER
enum int UNDECIMBER;

Value of the {@link #MONTH} field indicating the thirteenth month of the year. Although <code>GregorianCalendar</code> does not use this value, lunar calendars do.

WEDNESDAY
enum int WEDNESDAY;

Value of the {@link #DAY_OF_WEEK} field indicating Wednesday.

WEEK_OF_MONTH
enum int WEEK_OF_MONTH;

Field number for <code>get</code> and <code>set</code> indicating the week number within the current month. The first week of the month, as defined by <code>getFirstDayOfWeek()</code> and <code>getMinimalDaysInFirstWeek()</code>, has value 1. Subclasses define the value of <code>WEEK_OF_MONTH</code> for days before the first week of the month.

WEEK_OF_MONTH_MASK
enum int WEEK_OF_MONTH_MASK;
Undocumented in source.
WEEK_OF_YEAR
enum int WEEK_OF_YEAR;

Field number for <code>get</code> and <code>set</code> indicating the week number within the current year. The first week of the year, as defined by <code>getFirstDayOfWeek()</code> and <code>getMinimalDaysInFirstWeek()</code>, has value 1. Subclasses define the value of <code>WEEK_OF_YEAR</code> for days before the first week of the year.

WEEK_OF_YEAR_MASK
enum int WEEK_OF_YEAR_MASK;
Undocumented in source.
YEAR
enum int YEAR;

Field number for <code>get</code> and <code>set</code> indicating the year. This is a calendar-specific value; see subclass documentation.

YEAR_MASK
enum int YEAR_MASK;
Undocumented in source.
ZONE_OFFSET
enum int ZONE_OFFSET;

Field number for <code>get</code> and <code>set</code> indicating the raw offset from GMT in milliseconds. <p> This field reflects the correct GMT offset value of the time zone of this <code>Calendar</code> if the <code>TimeZone</code> implementation subclass supports historical GMT offset changes.

ZONE_OFFSET_MASK
enum int ZONE_OFFSET_MASK;
Undocumented in source.
areAllFieldsSet
bool areAllFieldsSet;

True if all fields have been set. @serial

areFieldsSet
bool areFieldsSet;

True if <code>fields[]</code> are in sync with the currently set time. If false, then the next attempt to get the value of a field will force a recomputation of all fields from the current value of <code>time</code>. @serial

currentSerialVersion
enum int currentSerialVersion;
Undocumented in source.
fields
int[] fields;

The calendar field values for the currently set time for this calendar. This is an array of <code>FIELD_COUNT</code> integers, with index values <code>ERA</code> through <code>DST_OFFSET</code>. @serial

isSet
bool[] isSet;

The flags which tell if a specified calendar field for the calendar is set. A new object has no fields set. After the first call to a method which generates the fields, they all remain set after that. This is an array of <code>FIELD_COUNT</code> bools, with index values <code>ERA</code> through <code>DST_OFFSET</code>. @serial

isTimeSet
bool isTimeSet;

True if then the value of <code>time</code> is valid. The time is made invalid by a change to an item of <code>field[]</code>. @see #time @serial

time
long time;

The currently set time for this calendar, expressed in milliseconds after January 1, 1970, 0:00:00 GMT. @see #isTimeSet @serial

Meta