Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Inherited Constants](https://developer.android.com/reference/android/icu/util/JapaneseCalendar#inhconstants) \| [Fields](https://developer.android.com/reference/android/icu/util/JapaneseCalendar#lfields) \| [Inherited Fields](https://developer.android.com/reference/android/icu/util/JapaneseCalendar#inhfields) \| [Ctors](https://developer.android.com/reference/android/icu/util/JapaneseCalendar#pubctors) \| [Methods](https://developer.android.com/reference/android/icu/util/JapaneseCalendar#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/icu/util/JapaneseCalendar#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/icu/util/JapaneseCalendar#inhmethods)

# JapaneseCalendar

*** ** * ** ***


`
public


class
JapaneseCalendar
`


`


`

`


`

`

extends https://developer.android.com/reference/android/icu/util/GregorianCalendar


`

`


`

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||
| ↳ | [android.icu.util.Calendar](https://developer.android.com/reference/android/icu/util/Calendar) |||
|   | ↳ | [android.icu.util.GregorianCalendar](https://developer.android.com/reference/android/icu/util/GregorianCalendar) ||
|   |   | ↳ | android.icu.util.JapaneseCalendar |

<br />

*** ** * ** ***

`JapaneseCalendar` is a subclass of `GregorianCalendar`
that numbers years and eras based on the reigns of the Japanese emperors.
The Japanese calendar is identical to the Gregorian calendar in all respects
except for the year and era. The ascension of each emperor to the throne
begins a new era, and the years of that era are numbered starting with the
year of ascension as year 1.


Note that in the year of an imperial ascension, there are two possible sets
of year and era values: that for the old era and for the new. For example, a
new era began on January 7, 1989 AD. Strictly speaking, the first six days
of that year were in the Showa era, e.g. "January 6, 64 Showa", while the rest
of the year was in the Heisei era, e.g. "January 7, 1 Heisei". This class
handles this distinction correctly when computing dates. However, in lenient
mode either form of date is acceptable as input.


In modern times, eras have started on January 8, 1868 AD, Gregorian (Meiji),
July 30, 1912 (Taisho), December 25, 1926 (Showa), and January 7, 1989 (Heisei). Constants
for these eras, suitable for use in the `ERA` field, are provided
in this class. Note that the *number* used for each era is more or
less arbitrary. Currently, the era starting in 645 AD is era #0; however this
may change in the future. Use the predefined constants rather than using actual,
absolute numbers.


Since ICU4J 63, start date of each era is imported from CLDR. CLDR era data
may contain tentative era in near future with placeholder names. By default,
such era data is not enabled. ICU4J users who want to test the behavior of
the future era can enable this by one of following settings (in the priority
order):

1. Java system property `ICU_ENABLE_TENTATIVE_ERA=true`.
2. Environment variable `ICU_ENABLE_TENTATIVE_ERA=true`.
3. Java system property `jdk.calendar.japanese.supplemental.era=xxx`. (Note: This configuration is used for specifying a new era's start date and names in OpenJDK. ICU4J implementation enables the CLDR tentative era when this property is defined, but it does not use the start date and names specified by the property value.)


This class should not be subclassed.


JapaneseCalendar usually should be instantiated using
`https://developer.android.com/reference/android/icu/util/Calendar#getInstance(android.icu.util.ULocale)` passing in a `ULocale`
with the tag `"@calendar=japanese"`.

<br />

**See also:**

- `https://developer.android.com/reference/android/icu/util/GregorianCalendar`
- `https://developer.android.com/reference/android/icu/util/Calendar`

## Summary

| ### Inherited constants |
|---|
| From class `https://developer.android.com/reference/android/icu/util/GregorianCalendar` |---|---| | `int` | `https://developer.android.com/reference/android/icu/util/GregorianCalendar#AD` Value of the `ERA` field indicating the common era (Anno Domini), also known as CE. | | `int` | `https://developer.android.com/reference/android/icu/util/GregorianCalendar#BC` Value of the `ERA` field indicating the period before the common era (before Christ), also known as BCE. | |
| From class `https://developer.android.com/reference/android/icu/util/Calendar` |---|---| | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#AM` Value of the `AM_PM` field indicating the period of the day from midnight to just before noon. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#AM_PM` Field number for `get` and `set` indicating whether the `HOUR` is before or after noon. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#APRIL` Value of the `MONTH` field indicating the fourth month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#AUGUST` Value of the `MONTH` field indicating the eighth month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DATE` Field number for `get` and `set` indicating the day of the month. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DAY_OF_MONTH` Field number for `get` and `set` indicating the day of the month. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DAY_OF_WEEK` Field number for `get` and `set` indicating the day of the week. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DAY_OF_WEEK_IN_MONTH` Field number for `get` and `set` indicating the ordinal number of the day of the week within the current month. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DAY_OF_YEAR` Field number for `get` and `set` indicating the day number within the current year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DECEMBER` Value of the `MONTH` field indicating the twelfth month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DOW_LOCAL` **\[icu\]** Field number for `get()` and `set()` indicating the localized day of week. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#DST_OFFSET` Field number for `get` and `set` indicating the daylight savings offset in milliseconds. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#EPOCH_JULIAN_DAY` The Julian day of the epoch, that is, January 1, 1970 on the Gregorian calendar. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#ERA` Field number for `get` and `set` indicating the era, e.g., AD or BC in the Julian calendar. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#EXTENDED_YEAR` **\[icu\]** Field number for `get()` and `set()` indicating the extended year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#FEBRUARY` Value of the `MONTH` field indicating the second month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#FRIDAY` Value of the `DAY_OF_WEEK` field indicating Friday. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#GREATEST_MINIMUM` Limit type for `getLimit()` and `handleGetLimit()` indicating the greatest minimum value that a field can take. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#HOUR` Field number for `get` and `set` indicating the hour of the morning or afternoon. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#HOUR_OF_DAY` Field number for `get` and `set` indicating the hour of the day. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#INTERNALLY_SET` Value of the time stamp `stamp[]` indicating that a field has been set via computations from the time or from other fields. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#IS_LEAP_MONTH` **\[icu\]** Field indicating whether or not the current month is a leap month. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#JANUARY` Value of the `MONTH` field indicating the first month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#JAN_1_1_JULIAN_DAY` The Julian day of the Gregorian epoch, that is, January 1, 1 on the Gregorian calendar. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#JULIAN_DAY` **\[icu\]** Field number for `get()` and `set()` indicating the modified Julian day number. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#JULY` Value of the `MONTH` field indicating the seventh month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#JUNE` Value of the `MONTH` field indicating the sixth month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#LEAST_MAXIMUM` Limit type for `getLimit()` and `handleGetLimit()` indicating the least maximum value that a field can take. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MARCH` Value of the `MONTH` field indicating the third month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MAXIMUM` Limit type for `getLimit()` and `handleGetLimit()` indicating the maximum value that a field can take (greatest maximum). | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MAX_FIELD_COUNT` *This constant was deprecated in API level 26. ICU 58 The numeric value may change over time, see ICU ticket #12420.* | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MAX_JULIAN` The maximum supported Julian day. | | `long` | `https://developer.android.com/reference/android/icu/util/Calendar#MAX_MILLIS` The maximum supported epoch milliseconds. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MAY` Value of the `MONTH` field indicating the fifth month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MILLISECOND` Field number for `get` and `set` indicating the millisecond within the second. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MILLISECONDS_IN_DAY` **\[icu\]** Field number for `get()` and `set()` indicating the milliseconds in the day. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MINIMUM` Limit type for `getLimit()` and `handleGetLimit()` indicating the minimum value that a field can take (least minimum). | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MINIMUM_USER_STAMP` If the time stamp `stamp[]` has a value greater than or equal to `MINIMUM_USER_SET` then it has been set by the user via a call to `set()`. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MINUTE` Field number for `get` and `set` indicating the minute within the hour. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MIN_JULIAN` The minimum supported Julian day. | | `long` | `https://developer.android.com/reference/android/icu/util/Calendar#MIN_MILLIS` The minimum supported epoch milliseconds. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MONDAY` Value of the `DAY_OF_WEEK` field indicating Monday. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#MONTH` Field number for `get` and `set` indicating the month. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#NOVEMBER` Value of the `MONTH` field indicating the eleventh month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#OCTOBER` Value of the `MONTH` field indicating the tenth month of the year. | | `long` | `https://developer.android.com/reference/android/icu/util/Calendar#ONE_DAY` The number of milliseconds in one day. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#ONE_HOUR` The number of milliseconds in one hour. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#ONE_MINUTE` The number of milliseconds in one minute. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#ONE_SECOND` The number of milliseconds in one second. | | `long` | `https://developer.android.com/reference/android/icu/util/Calendar#ONE_WEEK` The number of milliseconds in one week. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#ORDINAL_MONTH` **\[icu\]** Field indicating the month. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#PM` Value of the `AM_PM` field indicating the period of the day from noon to just before midnight. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#RESOLVE_REMAP` Value to OR against resolve table field values for remapping. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#SATURDAY` Value of the `DAY_OF_WEEK` field indicating Saturday. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#SECOND` Field number for `get` and `set` indicating the second within the minute. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#SEPTEMBER` Value of the `MONTH` field indicating the ninth month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#SUNDAY` Value of the `DAY_OF_WEEK` field indicating Sunday. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#THURSDAY` Value of the `DAY_OF_WEEK` field indicating Thursday. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#TUESDAY` Value of the `DAY_OF_WEEK` field indicating Tuesday. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#UNDECIMBER` Value of the `MONTH` field indicating the thirteenth month of the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#UNSET` Value of the time stamp `stamp[]` indicating that a field has not been set since the last call to `clear()`. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#WALLTIME_FIRST` **\[icu\]** Option used by `https://developer.android.com/reference/android/icu/util/Calendar#setRepeatedWallTimeOption(int)` and `https://developer.android.com/reference/android/icu/util/Calendar#setSkippedWallTimeOption(int)` specifying an ambiguous wall time to be interpreted as the earliest. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#WALLTIME_LAST` **\[icu\]** Option used by `https://developer.android.com/reference/android/icu/util/Calendar#setRepeatedWallTimeOption(int)` and `https://developer.android.com/reference/android/icu/util/Calendar#setSkippedWallTimeOption(int)` specifying an ambiguous wall time to be interpreted as the latest. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#WALLTIME_NEXT_VALID` **\[icu\]** Option used by `https://developer.android.com/reference/android/icu/util/Calendar#setSkippedWallTimeOption(int)` specifying an ambiguous wall time to be interpreted as the next valid wall time. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#WEDNESDAY` Value of the `DAY_OF_WEEK` field indicating Wednesday. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#WEEK_OF_MONTH` Field number for `get` and `set` indicating the week number within the current month. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#WEEK_OF_YEAR` Field number for `get` and `set` indicating the week number within the current year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#YEAR` Field number for `get` and `set` indicating the year. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#YEAR_WOY` **\[icu\]** Field number for `get()` and `set()` indicating the extended year corresponding to the `https://developer.android.com/reference/android/icu/util/Calendar#WEEK_OF_YEAR` field. | | `int` | `https://developer.android.com/reference/android/icu/util/Calendar#ZONE_OFFSET` Field number for `get` and `set` indicating the raw offset from GMT in milliseconds. | |

| ### Fields ||
|---|---|
| ` public static final int` | `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#HEISEI` Constant for the era starting on Jan. |
| ` public static final int` | `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#MEIJI` Constant for the era starting on Sept. |
| ` public static final int` | `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#REIWA` Constant for the era starting on May 1, 2019 AD. |
| ` public static final int` | `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#SHOWA` Constant for the era starting on Dec. |
| ` public static final int` | `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#TAISHO` Constant for the era starting on July 30, 1912 AD. |

| ### Inherited fields |
|---|
| From class `https://developer.android.com/reference/android/icu/util/GregorianCalendar` |---|---| | ` protected boolean` | `https://developer.android.com/reference/android/icu/util/GregorianCalendar#invertGregorian` Used by handleComputeJulianDay() and handleComputeMonthStart(). | | ` protected boolean` | `https://developer.android.com/reference/android/icu/util/GregorianCalendar#isGregorian` Used by handleComputeJulianDay() and handleComputeMonthStart(). | |
| From class `https://developer.android.com/reference/android/icu/util/Calendar` |---|---| | ` protected static final https://developer.android.com/reference/java/util/Date` | `https://developer.android.com/reference/android/icu/util/Calendar#MAX_DATE` The maximum supported `Date`. | | ` protected static final https://developer.android.com/reference/java/util/Date` | `https://developer.android.com/reference/android/icu/util/Calendar#MIN_DATE` The minimum supported `Date`. | |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar()() ` Constructs a default `JapaneseCalendar` using the current time in the default time zone with the default locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(android.icu.util.TimeZone)(https://developer.android.com/reference/android/icu/util/TimeZone zone) ` Constructs a `JapaneseCalendar` based on the current time in the given time zone with the default locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(android.icu.util.TimeZone,%20android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/TimeZone zone, https://developer.android.com/reference/android/icu/util/ULocale locale) ` Constructs a `JapaneseCalendar` based on the current time in the given time zone with the given locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(android.icu.util.TimeZone,%20java.util.Locale)(https://developer.android.com/reference/android/icu/util/TimeZone zone, https://developer.android.com/reference/java/util/Locale aLocale) ` Constructs a `JapaneseCalendar` based on the current time in the given time zone with the given locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale locale) ` Constructs a `JapaneseCalendar` based on the current time in the default time zone with the given locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(int,%20int,%20int)(int year, int month, int date) ` Constructs a `JapaneseCalendar` with the given date set in the default time zone with the default locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(int,%20int,%20int,%20int)(int era, int year, int month, int date) ` Constructs a `JapaneseCalendar` with the given date set in the default time zone with the default locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(int,%20int,%20int,%20int,%20int,%20int)(int year, int month, int date, int hour, int minute, int second) ` Constructs a `JapaneseCalendar` with the given date and time set for the default time zone with the default locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(java.util.Date)(https://developer.android.com/reference/java/util/Date date) ` Constructs a `JapaneseCalendar` with the given date set in the default time zone with the default locale. |
| ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#JapaneseCalendar(java.util.Locale)(https://developer.android.com/reference/java/util/Locale aLocale) ` Constructs a `JapaneseCalendar` based on the current time in the default time zone with the given locale. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#getActualMaximum(int)(int field) ` Return the maximum value that this field could have, given the current date. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#getType()() ` **\[icu\]** Returns the calendar type name string for this Calendar object. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#handleComputeFields(int)(int julianDay) ` Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system. |
| ` int` | ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#handleGetExtendedYear()() ` Returns the extended year defined by the current fields. |
| ` int` | ` https://developer.android.com/reference/android/icu/util/JapaneseCalendar#handleGetLimit(int,%20int)(int field, int limitType) ` Override GregorianCalendar. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/icu/util/GregorianCalendar ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#clone()() ` Overrides Cloneable | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#getActualMaximum(int)(int field) ` Return the maximum value that this field could have, given the current date. | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#getActualMinimum(int)(int field) ` Return the minimum value that this field could have, given the current date. | | ` final https://developer.android.com/reference/java/util/Date` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#getGregorianChange()() ` Gets the Gregorian Calendar change date. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#getType()() ` **\[icu\]** Returns the calendar type name string for this Calendar object. | | ` void` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#handleComputeFields(int)(int julianDay) ` Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system. | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#handleComputeJulianDay(int)(int bestField) ` Subclasses may override this. | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#handleComputeMonthStart(int,%20int,%20boolean)(int eyear, int month, boolean useMonth) ` Return JD of start of given month/year | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#handleGetExtendedYear()() ` Returns the extended year defined by the current fields. | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#handleGetLimit(int,%20int)(int field, int limitType) ` Subclass API for defining limits of different types. | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#handleGetMonthLength(int,%20int)(int extendedYear, int month) ` Returns the number of days in the given month of the given extended year of this calendar system. | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#handleGetYearLength(int)(int eyear) ` Returns the number of days in the given extended year of this calendar system. | | ` int` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#hashCode()() ` Override hashCode. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#isEquivalentTo(android.icu.util.Calendar)(https://developer.android.com/reference/android/icu/util/Calendar other) ` Returns true if the given Calendar object is equivalent to this one. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#isLeapYear(int)(int year) ` Determines if the given year is a leap year. | | ` void` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#roll(int,%20int)(int field, int amount) ` Roll a field by a signed amount. | | ` void` | ` https://developer.android.com/reference/android/icu/util/GregorianCalendar#setGregorianChange(java.util.Date)(https://developer.android.com/reference/java/util/Date date) ` Sets the GregorianCalendar change date. | ||
| From class ` https://developer.android.com/reference/android/icu/util/Calendar ` |---|---| | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#add(int,%20int)(int field, int amount) ` Add a signed amount to a specified field, using this calendar's rules. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#after(java.lang.Object)(https://developer.android.com/reference/java/lang/Object when) ` Compares the time field records. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#before(java.lang.Object)(https://developer.android.com/reference/java/lang/Object when) ` Compares the time field records. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#clear()() ` Clears the values of all the time fields. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#clear(int)(int field) ` Clears the value in the given time field. | | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/icu/util/Calendar#clone()() ` Overrides Cloneable | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#compareTo(android.icu.util.Calendar)(https://developer.android.com/reference/android/icu/util/Calendar that) ` Compares the times (in millis) represented by two `Calendar` objects. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#complete()() ` Fills in any unset fields in the time field list. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#computeFields()() ` Converts the current millisecond time value `time` to field values in `fields[]`. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#computeGregorianFields(int)(int julianDay) ` Compute the Gregorian calendar year, month, and day of month from the Julian day. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#computeGregorianMonthStart(int,%20int)(int year, int month) ` Compute the Julian day of a month of the Gregorian calendar. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#computeJulianDay()() ` Compute the Julian day number as specified by this calendar's fields. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#computeMillisInDay()() ` *This method was deprecated in API level 26. ICU 60* | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#computeTime()() ` Converts the current field values in `fields[]` to the millisecond time value `time`. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#computeZoneOffset(long,%20int)(long millis, int millisInDay) ` *This method was deprecated in API level 26. ICU 60* | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Compares this calendar to the specified object. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#fieldDifference(java.util.Date,%20int)(https://developer.android.com/reference/java/util/Date when, int field) ` **\[icu\]** Returns the difference between the given time and the time this calendar object is set to. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/Calendar#fieldName(int)(int field) ` Returns a string name for a field, for debugging and exceptions. | | ` static final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#floorDivide(int,%20int,%20int[])(int numerator, int denominator, int[] remainder) ` Divide two integers, returning the floor of the quotient, and the modulus remainder. | | ` static final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#floorDivide(int,%20int)(int numerator, int denominator) ` Divide two integers, returning the floor of the quotient. | | ` static final long` | ` https://developer.android.com/reference/android/icu/util/Calendar#floorDivide(long,%20long)(long numerator, long denominator) ` Divide two long integers, returning the floor of the quotient. | | ` static final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#floorDivide(long,%20int,%20int[])(long numerator, int denominator, int[] remainder) ` Divide two integers, returning the floor of the quotient, and the modulus remainder. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#get(int)(int field) ` Returns the value for a given time field. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getActualMaximum(int)(int field) ` Returns the maximum value that this field could have, given the current date. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getActualMinimum(int)(int field) ` Returns the minimum value that this field could have, given the current date. | | ` static https://developer.android.com/reference/java/util/Locale` | ` https://developer.android.com/reference/android/icu/util/Calendar#getAvailableLocales()() ` Returns the list of locales for which Calendars are installed. | | ` https://developer.android.com/reference/android/icu/text/DateFormat` | ` https://developer.android.com/reference/android/icu/util/Calendar#getDateTimeFormat(int,%20int,%20android.icu.util.ULocale)(int dateStyle, int timeStyle, https://developer.android.com/reference/android/icu/util/ULocale loc) ` **\[icu\]** Returns a `DateFormat` appropriate to this calendar. | | ` https://developer.android.com/reference/android/icu/text/DateFormat` | ` https://developer.android.com/reference/android/icu/util/Calendar#getDateTimeFormat(int,%20int,%20java.util.Locale)(int dateStyle, int timeStyle, https://developer.android.com/reference/java/util/Locale loc) ` **\[icu\]** Returns a `DateFormat` appropriate to this calendar. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/Calendar#getDisplayName(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale loc) ` Returns the name of this calendar in the language of the given locale. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/Calendar#getDisplayName(java.util.Locale)(https://developer.android.com/reference/java/util/Locale loc) ` Returns the name of this calendar in the language of the given locale. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getFieldCount()() ` **\[icu\]** Returns the number of fields defined by this calendar. | | ` int[][][]` | ` https://developer.android.com/reference/android/icu/util/Calendar#getFieldResolutionTable()() ` Returns the field resolution array for this calendar. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getFirstDayOfWeek()() ` Returns what the first day of the week is, where 1 = `https://developer.android.com/reference/android/icu/util/Calendar#SUNDAY` and 7 = `https://developer.android.com/reference/android/icu/util/Calendar#SATURDAY`. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getGreatestMinimum(int)(int field) ` Returns the highest minimum value for the given field if varies. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getGregorianDayOfMonth()() ` Returns the day of month (1-based) on the Gregorian calendar as computed by `computeGregorianFields()`. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getGregorianDayOfYear()() ` Returns the day of year (1-based) on the Gregorian calendar as computed by `computeGregorianFields()`. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getGregorianMonth()() ` Returns the month (0-based) on the Gregorian calendar as computed by `computeGregorianFields()`. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getGregorianYear()() ` Returns the extended year on the Gregorian calendar as computed by `computeGregorianFields()`. | | ` static https://developer.android.com/reference/android/icu/util/Calendar` | ` https://developer.android.com/reference/android/icu/util/Calendar#getInstance()() ` Returns a calendar using the default time zone and locale. | | ` static https://developer.android.com/reference/android/icu/util/Calendar` | ` https://developer.android.com/reference/android/icu/util/Calendar#getInstance(java.util.Locale)(https://developer.android.com/reference/java/util/Locale aLocale) ` Returns a calendar using the default time zone and specified locale. | | ` static https://developer.android.com/reference/android/icu/util/Calendar` | ` https://developer.android.com/reference/android/icu/util/Calendar#getInstance(android.icu.util.TimeZone,%20java.util.Locale)(https://developer.android.com/reference/android/icu/util/TimeZone zone, https://developer.android.com/reference/java/util/Locale aLocale) ` Returns a calendar with the specified time zone and locale. | | ` static https://developer.android.com/reference/android/icu/util/Calendar` | ` https://developer.android.com/reference/android/icu/util/Calendar#getInstance(android.icu.util.TimeZone,%20android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/TimeZone zone, https://developer.android.com/reference/android/icu/util/ULocale locale) ` Returns a calendar with the specified time zone and locale. | | ` static https://developer.android.com/reference/android/icu/util/Calendar` | ` https://developer.android.com/reference/android/icu/util/Calendar#getInstance(android.icu.util.TimeZone)(https://developer.android.com/reference/android/icu/util/TimeZone zone) ` Returns a calendar using the specified time zone and default locale. | | ` static https://developer.android.com/reference/android/icu/util/Calendar` | ` https://developer.android.com/reference/android/icu/util/Calendar#getInstance(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale locale) ` Returns a calendar using the default time zone and specified locale. | | ` static final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/Calendar#getKeywordValuesForLocale(java.lang.String,%20android.icu.util.ULocale,%20boolean)(https://developer.android.com/reference/java/lang/String key, https://developer.android.com/reference/android/icu/util/ULocale locale, boolean commonlyUsed) ` **\[icu\]** Given a key and a locale, returns an array of string values in a preferred order that would make a difference. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getLeastMaximum(int)(int field) ` Returns the lowest maximum value for the given field if varies. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getLimit(int,%20int)(int field, int limitType) ` Returns a limit for a field. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getMaximum(int)(int field) ` Returns the maximum value for the given time field. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getMinimalDaysInFirstWeek()() ` Returns what the minimal days required in the first week of the year are. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getMinimum(int)(int field) ` Returns the minimum value for the given time field. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getRepeatedWallTimeOption()() ` **\[icu\]**Gets the behavior for handling wall time repeating multiple times at negative time zone offset transitions. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getSkippedWallTimeOption()() ` **\[icu\]**Gets the behavior for handling skipped wall time at positive time zone offset transitions. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#getStamp(int)(int field) ` Returns the timestamp of a field. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/Calendar#getTemporalMonthCode()() ` Gets The Temporal monthCode value corresponding to the month for the date. | | ` final https://developer.android.com/reference/java/util/Date` | ` https://developer.android.com/reference/android/icu/util/Calendar#getTime()() ` Returns this Calendar's current time. | | ` long` | ` https://developer.android.com/reference/android/icu/util/Calendar#getTimeInMillis()() ` Returns this Calendar's current time as a long. | | ` https://developer.android.com/reference/android/icu/util/TimeZone` | ` https://developer.android.com/reference/android/icu/util/Calendar#getTimeZone()() ` Returns the time zone. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/Calendar#getType()() ` **\[icu\]** Returns the calendar type name string for this Calendar object. | | ` https://developer.android.com/reference/android/icu/util/Calendar.WeekData` | ` https://developer.android.com/reference/android/icu/util/Calendar#getWeekData()() ` **\[icu\]** Return simple, immutable struct-like class for access to the week data in this calendar. | | ` static https://developer.android.com/reference/android/icu/util/Calendar.WeekData` | ` https://developer.android.com/reference/android/icu/util/Calendar#getWeekDataForRegion(java.lang.String)(https://developer.android.com/reference/java/lang/String region) ` **\[icu\]** Return simple, immutable struct-like class for access to the CLDR week data. | | ` static final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#gregorianMonthLength(int,%20int)(int y, int m) ` Returns the length of a month of the Gregorian calendar. | | ` static final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#gregorianPreviousMonthLength(int,%20int)(int y, int m) ` Returns the length of a previous month of the Gregorian calendar. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleComputeFields(int)(int julianDay) ` Subclasses may override this method to compute several fields specific to each calendar system. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleComputeJulianDay(int)(int bestField) ` Subclasses may override this. | | ` abstract int` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleComputeMonthStart(int,%20int,%20boolean)(int eyear, int month, boolean useMonth) ` Returns the Julian day number of day before the first day of the given month in the given extended year. | | ` int[]` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleCreateFields()() ` Subclasses that use additional fields beyond those defined in `Calendar` should override this method to return an `int[]` array of the appropriate length. | | ` https://developer.android.com/reference/android/icu/text/DateFormat` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleGetDateFormat(java.lang.String,%20java.lang.String,%20java.util.Locale)(https://developer.android.com/reference/java/lang/String pattern, https://developer.android.com/reference/java/lang/String override, https://developer.android.com/reference/java/util/Locale locale) ` Creates a `DateFormat` appropriate to this calendar. | | ` https://developer.android.com/reference/android/icu/text/DateFormat` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleGetDateFormat(java.lang.String,%20android.icu.util.ULocale)(https://developer.android.com/reference/java/lang/String pattern, https://developer.android.com/reference/android/icu/util/ULocale locale) ` Creates a `DateFormat` appropriate to this calendar. | | ` https://developer.android.com/reference/android/icu/text/DateFormat` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleGetDateFormat(java.lang.String,%20java.util.Locale)(https://developer.android.com/reference/java/lang/String pattern, https://developer.android.com/reference/java/util/Locale locale) ` Creates a `DateFormat` appropriate to this calendar. | | ` abstract int` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleGetExtendedYear()() ` Returns the extended year defined by the current fields. | | ` abstract int` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleGetLimit(int,%20int)(int field, int limitType) ` Subclass API for defining limits of different types. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleGetMonthLength(int,%20int)(int extendedYear, int month) ` Returns the number of days in the given month of the given extended year of this calendar system. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#handleGetYearLength(int)(int eyear) ` Returns the number of days in the given extended year of this calendar system. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#hashCode()() ` Returns a hash code for this calendar. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#inTemporalLeapYear()() ` **\[icu\]** Returns true if the date is in a leap year. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#internalGet(int)(int field) ` Returns the value for a given time field. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#internalGet(int,%20int)(int field, int defaultValue) ` Returns the value for a given time field, or return the given default value if the field is not set. | | ` final long` | ` https://developer.android.com/reference/android/icu/util/Calendar#internalGetTimeInMillis()() ` Returns the current milliseconds without recomputing. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#internalSet(int,%20int)(int field, int value) ` Set a field to a value. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#isEquivalentTo(android.icu.util.Calendar)(https://developer.android.com/reference/android/icu/util/Calendar other) ` **\[icu\]** Returns true if the given Calendar object is equivalent to this one. | | ` static final boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#isGregorianLeapYear(int)(int year) ` Determines if the given year is a leap year. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#isLenient()() ` Tell whether date/time interpretation is to be lenient. | | ` final boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#isSet(int)(int field) ` Determines if the given time field has a value set. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#isWeekend(java.util.Date)(https://developer.android.com/reference/java/util/Date date) ` **\[icu\]** Returns true if the given date and time is in the weekend in this calendar system. | | ` boolean` | ` https://developer.android.com/reference/android/icu/util/Calendar#isWeekend()() ` **\[icu\]** Returns true if this Calendar's current date and time is in the weekend in this calendar system. | | ` static final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#julianDayToDayOfWeek(int)(int julian) ` Returns the day of week, from SUNDAY to SATURDAY, given a Julian day. | | ` static final long` | ` https://developer.android.com/reference/android/icu/util/Calendar#julianDayToMillis(int)(int julian) ` Converts Julian day to time as milliseconds. | | ` static final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#millisToJulianDay(long)(long millis) ` Converts time as milliseconds to Julian day. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#newerField(int,%20int)(int defaultField, int alternateField) ` Returns the field that is newer, either defaultField, or alternateField. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#newestStamp(int,%20int,%20int)(int first, int last, int bestStampSoFar) ` Returns the newest stamp of a given range of fields. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#pinField(int)(int field) ` Adjust the specified field so that it is within the allowable range for the date to which this calendar is set. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#prepareGetActual(int,%20boolean)(int field, boolean isMinimum) ` Prepare this calendar for computing the actual minimum or maximum. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#resolveFields(int[][][])(int[][][] precedenceTable) ` Given a precedence table, return the newest field combination in the table, or -1 if none is found. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#roll(int,%20boolean)(int field, boolean up) ` Rolls (up/down) a single unit of time on the given field. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#roll(int,%20int)(int field, int amount) ` Rolls (up/down) a specified amount time on the given field. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#set(int,%20int,%20int,%20int,%20int,%20int)(int year, int month, int date, int hour, int minute, int second) ` Sets the values for the fields year, month, date, hour, minute, and second. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#set(int,%20int,%20int,%20int,%20int)(int year, int month, int date, int hour, int minute) ` Sets the values for the fields year, month, date, hour, and minute. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#set(int,%20int)(int field, int value) ` Sets the time field with the given value. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#set(int,%20int,%20int)(int year, int month, int date) ` Sets the values for the fields year, month, and date. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setFirstDayOfWeek(int)(int value) ` Sets what the first day of the week is, where 1 = `https://developer.android.com/reference/android/icu/util/Calendar#SUNDAY` and 7 = `https://developer.android.com/reference/android/icu/util/Calendar#SATURDAY`. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setLenient(boolean)(boolean lenient) ` Specify whether or not date/time interpretation is to be lenient. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setMinimalDaysInFirstWeek(int)(int value) ` Sets what the minimal days required in the first week of the year are. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setRepeatedWallTimeOption(int)(int option) ` **\[icu\]**Sets the behavior for handling wall time repeating multiple times at negative time zone offset transitions. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setSkippedWallTimeOption(int)(int option) ` **\[icu\]**Sets the behavior for handling skipped wall time at positive time zone offset transitions. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setTemporalMonthCode(java.lang.String)(https://developer.android.com/reference/java/lang/String temporalMonth) ` Sets The Temporal monthCode which is a string identifier that starts with the literal grapheme "M" followed by two graphemes representing the zero-padded month number of the current month in a normal (non-leap) year and suffixed by an optional literal grapheme "L" if this is a leap month in a lunisolar calendar. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setTime(java.util.Date)(https://developer.android.com/reference/java/util/Date date) ` Sets this Calendar's current time with the given Date. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setTimeInMillis(long)(long millis) ` Sets this Calendar's current time from the given long value. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#setTimeZone(android.icu.util.TimeZone)(https://developer.android.com/reference/android/icu/util/TimeZone value) ` Sets the time zone with the given time zone value. | | ` https://developer.android.com/reference/android/icu/util/Calendar` | ` https://developer.android.com/reference/android/icu/util/Calendar#setWeekData(android.icu.util.Calendar.WeekData)(https://developer.android.com/reference/android/icu/util/Calendar.WeekData wdata) ` **\[icu\]** Set data in this calendar based on the WeekData input. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/util/Calendar#toString()() ` Returns a string representation of this calendar. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#validateField(int)(int field) ` Validate a single field of this calendar. | | ` final void` | ` https://developer.android.com/reference/android/icu/util/Calendar#validateField(int,%20int,%20int)(int field, int min, int max) ` Validate a single field of this calendar given its minimum and maximum allowed value. | | ` void` | ` https://developer.android.com/reference/android/icu/util/Calendar#validateFields()() ` Ensure that each field is within its valid range by calling `https://developer.android.com/reference/android/icu/util/Calendar#validateField(int)` on each field that has been set. | | ` int` | ` https://developer.android.com/reference/android/icu/util/Calendar#weekNumber(int,%20int,%20int)(int desiredDay, int dayOfPeriod, int dayOfWeek) ` Returns the week number of a day, within a period. | | ` final int` | ` https://developer.android.com/reference/android/icu/util/Calendar#weekNumber(int,%20int)(int dayOfPeriod, int dayOfWeek) ` Returns the week number of a day, within a period. | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/java/lang/Comparable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/java/lang/Comparable#compareTo(T)(https://developer.android.com/reference/android/icu/util/Calendar o) ` Compares this object with the specified object for order. | ||

## Fields

### HEISEI

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int HEISEI
```

Constant for the era starting on Jan. 7, 1989 AD.

<br />

### MEIJI

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MEIJI
```

Constant for the era starting on Sept. 8, 1868 AD.

<br />

### REIWA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int REIWA
```

Constant for the era starting on May 1, 2019 AD.

<br />

### SHOWA

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SHOWA
```

Constant for the era starting on Dec. 25, 1926 AD.

<br />

### TAISHO

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TAISHO
```

Constant for the era starting on July 30, 1912 AD.

<br />

## Public constructors

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar ()
```

Constructs a default `JapaneseCalendar` using the current time
in the default time zone with the default locale.

<br />

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (TimeZone zone)
```

Constructs a `JapaneseCalendar` based on the current time
in the given time zone with the default locale.

<br />

| Parameters ||
|---|---|
| `zone` | `TimeZone`: the given time zone. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (TimeZone zone, 
                ULocale locale)
```

Constructs a `JapaneseCalendar` based on the current time
in the given time zone with the given locale.

<br />

| Parameters ||
|---|---|
| `zone` | `TimeZone`: the given time zone. <br /> |
| `locale` | `ULocale`: the given ulocale. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (TimeZone zone, 
                Locale aLocale)
```

Constructs a `JapaneseCalendar` based on the current time
in the given time zone with the given locale.

<br />

| Parameters ||
|---|---|
| `zone` | `TimeZone`: the given time zone. <br /> |
| `aLocale` | `Locale`: the given locale. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (ULocale locale)
```

Constructs a `JapaneseCalendar` based on the current time
in the default time zone with the given locale.

<br />

| Parameters ||
|---|---|
| `locale` | `ULocale`: the given ulocale. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (int year, 
                int month, 
                int date)
```

Constructs a `JapaneseCalendar` with the given date set
in the default time zone with the default locale.

<br />

| Parameters ||
|---|---|
| `year` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#YEAR` field, in the era Heisei, the most current at the time this class was last updated. <br /> |
| `month` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#MONTH` field. The value is 0-based. e.g., 0 for January. <br /> |
| `date` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#DATE` field. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (int era, 
                int year, 
                int month, 
                int date)
```

Constructs a `JapaneseCalendar` with the given date set
in the default time zone with the default locale.

<br />

| Parameters ||
|---|---|
| `era` | `int`: The imperial era used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#ERA` field. Eras are numbered starting with the Tenki era, which began in 1053 AD Gregorian, as era zero. Recent eras can be specified using the constants `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#MEIJI` (which started in 1868 AD), `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#TAISHO` (1912 AD), `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#SHOWA` (1926 AD), and `https://developer.android.com/reference/android/icu/util/JapaneseCalendar#HEISEI` (1989 AD). <br /> |
| `year` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#YEAR` field, in terms of the era. <br /> |
| `month` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#MONTH` field. The value is 0-based. e.g., 0 for January. <br /> |
| `date` | `int`: The value used to set the calendar's DATE field. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (int year, 
                int month, 
                int date, 
                int hour, 
                int minute, 
                int second)
```

Constructs a `JapaneseCalendar` with the given date
and time set for the default time zone with the default locale.

<br />

| Parameters ||
|---|---|
| `year` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#YEAR` time field, in the era Heisei, the most current at the time of this writing. <br /> |
| `month` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#MONTH` time field. The value is 0-based. e.g., 0 for January. <br /> |
| `date` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#DATE` time field. <br /> |
| `hour` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#HOUR_OF_DAY` time field. <br /> |
| `minute` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#MINUTE` time field. <br /> |
| `second` | `int`: The value used to set the calendar's `https://developer.android.com/reference/android/icu/util/Calendar#SECOND` time field. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (Date date)
```

Constructs a `JapaneseCalendar` with the given date set
in the default time zone with the default locale.

<br />

| Parameters ||
|---|---|
| `date` | `Date`: The date to which the new calendar is set. <br /> |

### JapaneseCalendar

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public JapaneseCalendar (Locale aLocale)
```

Constructs a `JapaneseCalendar` based on the current time
in the default time zone with the given locale.

<br />

| Parameters ||
|---|---|
| `aLocale` | `Locale`: the given locale. <br /> |

## Public methods

### getActualMaximum

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getActualMaximum (int field)
```

Return the maximum value that this field could have, given the current date.
For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual
maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar,
for some years the actual maximum for MONTH is 12, and for others 13.

<br />

| Parameters ||
|---|---|
| `field` | `int`: the field whose maximum is desired <br /> |

| Returns ||
|---|---|
| `int` | the maximum of the given field for the current date of this calendar <br /> |

### getType

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getType ()
```

**\[icu\]** Returns the calendar type name string for this Calendar object.
The returned string is the legacy ICU calendar attribute value,
for example, "gregorian" or "japanese".

See type="old type name" for the calendar attribute of locale IDs
at http://www.unicode.org/reports/tr35/#Key_Type_Definitions

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | legacy calendar type name string <br /> |

## Protected methods

### handleComputeFields

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void handleComputeFields (int julianDay)
```

Override Calendar to compute several fields specific to the hybrid
Gregorian-Julian calendar system. These are:

- ERA
- YEAR
- MONTH
- DAY_OF_MONTH
- DAY_OF_YEAR
- EXTENDED_YEAR

<br />

<br />

| Parameters ||
|---|---|
| `julianDay` | `int` <br /> |

### handleGetExtendedYear

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected int handleGetExtendedYear ()
```

Returns the extended year defined by the current fields. This will
use the EXTENDED_YEAR field or the YEAR and supra-year fields (such
as ERA) specific to the calendar system, depending on which set of
fields is newer.

<br />

| Returns ||
|---|---|
| `int` | the extended year <br /> |

### handleGetLimit

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected int handleGetLimit (int field, 
                int limitType)
```

Override GregorianCalendar. We should really handle YEAR_WOY and
EXTENDED_YEAR here too to implement the 1..5000000 range, but it's
not critical.

<br />

| Parameters ||
|---|---|
| `field` | `int`: one of the above field numbers <br /> |
| `limitType` | `int`: one of `MINIMUM`, `GREATEST_MINIMUM`, `LEAST_MAXIMUM`, or `MAXIMUM` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |