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 1053 AD is era #0; however this may change in the future as we add more historical data. Use the predefined constants rather than using actual, absolute numbers.
This class should not be subclassed.
JapaneseCalendar usually should be instantiated using {@link com.ibm.icu.util.Calendar#getInstance(ULocale)} passing in a ULocale
with the tag "@calendar=japanese"
.
|
|