@Deprecated public class PersianCalendar extends Calendar
PersianCalendar
is a subclass of Calendar
that
that implements the Persian calendar. It is used as the main civil
calendar in Iran and Afghanistan, and by Iranians and Afghans worldwide.
The Persian calendar is solar, and is similar to the Gregorian calendar in various ways, except its leap year rule, which is determined astronomically. The Persian year starts around the March equinox.
The modern Persian calendar (used in Iran since 1925 CE and in Afghanistan since 1957 CE), has the lengths of the months fixed. The first six months are 31 days each, the next five months are 30 days each, and the final month is 29 days in non-leap years and 30 days in leap ones. Historically, the lengths of the month differed in different years, but they were finally fixed at the times mentioned above. Partial information is available about the historical lengths.
The official rule for determination of the beginning of the Persian year is locale dependent, but at the same time, it has not specified a locale. Iranians around the world traditionally follow the calendar authorities of Iran, which haven't officially specified the locale. Some calendarists use some point in Tehran as the locale, while others have tried the more neutral 52.5 degrees east meridian. It is not clear which locale should be used for the Persian calendar of Afghanistan, but it is expected that for about one year in every twenty-four years, the Afghan calendar may become different from the Iranian one.
The exact locale to be used for the Iranian calendar starts to make a difference at around 2090 CE. The specific arithmetic method implemented here, commonly known as the 33-year cycle rule, matches the astronomical calendar at least for the whole period that the calendar has been both well-defined and official, from 1925 to around 2090 CE. The other commonly known algorithm, the 2820-year cycle, has been incorrectly designed to follow the tropical year instead of the spring equinoctial year, and fails to match the astronomical one as early as 2025 CE.
This class should not be subclassed.
PersianCalendar usually should be instantiated using
Calendar.getInstance(ULocale)
passing in a
ULocale
with the tag "@calendar=persian"
.
GregorianCalendar
,
Calendar
,
Serialized FormCalendar.FormatConfiguration, Calendar.WeekData
AM, AM_PM, APRIL, AUGUST, BASE_FIELD_COUNT, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DOW_LOCAL, DST_OFFSET, EPOCH_JULIAN_DAY, ERA, EXTENDED_YEAR, FEBRUARY, FRIDAY, GREATEST_MINIMUM, HOUR, HOUR_OF_DAY, INTERNALLY_SET, IS_LEAP_MONTH, JAN_1_1_JULIAN_DAY, JANUARY, JULIAN_DAY, JULY, JUNE, LEAST_MAXIMUM, MARCH, MAX_DATE, MAX_FIELD_COUNT, MAX_JULIAN, MAX_MILLIS, MAXIMUM, MAY, MILLISECOND, MILLISECONDS_IN_DAY, MIN_DATE, MIN_JULIAN, MIN_MILLIS, MINIMUM, MINIMUM_USER_STAMP, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ORDINAL_MONTH, PM, RESOLVE_REMAP, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, UNSET, WALLTIME_FIRST, WALLTIME_LAST, WALLTIME_NEXT_VALID, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, WEEKDAY, WEEKEND, WEEKEND_CEASE, WEEKEND_ONSET, YEAR, YEAR_WOY, ZONE_OFFSET
Constructor and Description |
---|
PersianCalendar()
Deprecated.
This API is ICU internal only.
|
PersianCalendar(Date date)
Deprecated.
This API is ICU internal only.
|
PersianCalendar(int year,
int month,
int date)
Deprecated.
This API is ICU internal only.
|
PersianCalendar(int year,
int month,
int date,
int hour,
int minute,
int second)
Deprecated.
This API is ICU internal only.
|
PersianCalendar(Locale aLocale)
Deprecated.
This API is ICU internal only.
|
PersianCalendar(TimeZone zone)
Deprecated.
This API is ICU internal only.
|
PersianCalendar(TimeZone zone,
Locale aLocale)
Deprecated.
This API is ICU internal only.
|
PersianCalendar(TimeZone zone,
ULocale locale)
Deprecated.
This API is ICU internal only.
|
PersianCalendar(ULocale locale)
Deprecated.
This API is ICU internal only.
|
Modifier and Type | Method and Description |
---|---|
String |
getType()
Deprecated.
This API is ICU internal only.
|
protected void |
handleComputeFields(int julianDay)
Deprecated.
This API is ICU internal only.
|
protected int |
handleComputeMonthStart(int eyear,
int month,
boolean useMonth)
Deprecated.
This API is ICU internal only.
|
protected int |
handleGetExtendedYear()
Deprecated.
This API is ICU internal only.
|
protected int |
handleGetLimit(int field,
int limitType)
Deprecated.
This API is ICU internal only.
|
protected int |
handleGetMonthLength(int extendedYear,
int month)
Deprecated.
This API is ICU internal only.
|
protected int |
handleGetYearLength(int extendedYear)
Deprecated.
This API is ICU internal only.
|
add, after, before, clear, clear, clone, compareTo, complete, computeFields, computeGregorianFields, computeGregorianMonthStart, computeJulianDay, computeMillisInDay, computeMillisInDayLong, computeTime, computeZoneOffset, computeZoneOffset, equals, fieldDifference, fieldName, floorDivide, floorDivide, floorDivide, floorDivide, get, getActualMaximum, getActualMinimum, getAvailableLocales, getAvailableULocales, getDateAtTimePattern, getDateTimeFormat, getDateTimeFormat, getDateTimePattern, getDayOfWeekType, getDefaultDayInMonth, getDefaultMonthInYear, getDisplayName, getDisplayName, getFieldCount, getFieldResolutionTable, getFirstDayOfWeek, getGreatestMinimum, getGregorianDayOfMonth, getGregorianDayOfYear, getGregorianMonth, getGregorianYear, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getKeywordValuesForLocale, getLeastMaximum, getLimit, getLocale, getMaximum, getMinimalDaysInFirstWeek, getMinimum, getRelatedYear, getRepeatedWallTimeOption, getSkippedWallTimeOption, getStamp, getTemporalMonthCode, getTime, getTimeInMillis, getTimeZone, getWeekData, getWeekDataForRegion, getWeekendTransition, gregorianMonthLength, gregorianPreviousMonthLength, handleComputeJulianDay, handleCreateFields, handleGetDateFormat, handleGetDateFormat, handleGetDateFormat, handleGetDateFormat, hashCode, haveDefaultCentury, inTemporalLeapYear, internalGet, internalGet, internalGetMonth, internalGetMonth, internalGetTimeInMillis, internalSet, isEquivalentTo, isEra0CountingBackward, isGregorianLeapYear, isLenient, isSet, isWeekend, isWeekend, julianDayToDayOfWeek, julianDayToMillis, millisToJulianDay, newerField, newestStamp, pinField, prepareGetActual, resolveFields, roll, roll, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setRelatedYear, setRepeatedWallTimeOption, setSkippedWallTimeOption, setTemporalMonthCode, setTime, setTimeInMillis, setTimeZone, setWeekData, toString, validateField, validateField, validateFields, weekNumber, weekNumber
@Deprecated public PersianCalendar()
PersianCalendar
using the current time
in the default time zone with the default FORMAT
locale.ULocale.Category.FORMAT
@Deprecated public PersianCalendar(TimeZone zone)
PersianCalendar
based on the current time
in the given time zone with the default FORMAT
locale.zone
- the given time zone.ULocale.Category.FORMAT
@Deprecated public PersianCalendar(Locale aLocale)
PersianCalendar
based on the current time
in the default time zone with the given locale.aLocale
- the given locale.@Deprecated public PersianCalendar(ULocale locale)
PersianCalendar
based on the current time
in the default time zone with the given locale.locale
- the given ulocale.@Deprecated public PersianCalendar(TimeZone zone, Locale aLocale)
PersianCalendar
based on the current time
in the given time zone with the given locale.zone
- the given time zone.aLocale
- the given locale.@Deprecated public PersianCalendar(TimeZone zone, ULocale locale)
PersianCalendar
based on the current time
in the given time zone with the given locale.zone
- the given time zone.locale
- the given ulocale.@Deprecated public PersianCalendar(Date date)
PersianCalendar
with the given date set
in the default time zone with the default FORMAT
locale.date
- The date to which the new calendar is set.ULocale.Category.FORMAT
@Deprecated public PersianCalendar(int year, int month, int date)
PersianCalendar
with the given date set
in the default time zone with the default FORMAT
locale.year
- the value used to set the YEAR
time field in the calendar.month
- the value used to set the MONTH
time field in the calendar.
Note that the month value is 0-based. e.g., 0 for Farvardin.date
- the value used to set the DATE
time field in the calendar.ULocale.Category.FORMAT
@Deprecated public PersianCalendar(int year, int month, int date, int hour, int minute, int second)
PersianCalendar
with the given date
and time set for the default time zone with the default FORMAT
locale.year
- the value used to set the YEAR
time field in the calendar.month
- the value used to set the MONTH
time field in the calendar.
Note that the month value is 0-based. e.g., 0 for Farvardin.date
- the value used to set the DATE
time field in the calendar.hour
- the value used to set the HOUR_OF_DAY
time field
in the calendar.minute
- the value used to set the MINUTE
time field
in the calendar.second
- the value used to set the SECOND
time field
in the calendar.ULocale.Category.FORMAT
@Deprecated protected int handleGetLimit(int field, int limitType)
Calendar
ERA YEAR MONTH WEEK_OF_YEAR WEEK_OF_MONTH DAY_OF_MONTH DAY_OF_YEAR DAY_OF_WEEK_IN_MONTH YEAR_WOY EXTENDED_YEAR
handleGetLimit
in class Calendar
field
- one of the above field numberslimitType
- one of MINIMUM
, GREATEST_MINIMUM
,
LEAST_MAXIMUM
, or MAXIMUM
@Deprecated protected int handleGetMonthLength(int extendedYear, int month)
handleGetMonthLength
in class Calendar
extendedYear
- The Persian yearmonth
- The Persian month, 0-based@Deprecated protected int handleGetYearLength(int extendedYear)
handleGetYearLength
in class Calendar
@Deprecated protected int handleComputeMonthStart(int eyear, int month, boolean useMonth)
handleComputeMonthStart
in class Calendar
eyear
- the extended yearmonth
- the zero-based month, or 0 if useMonth is falseuseMonth
- if false, compute the day before the first day of
the given year, otherwise, compute the day before the first day of
the given month@Deprecated protected int handleGetExtendedYear()
Calendar
handleGetExtendedYear
in class Calendar
@Deprecated protected void handleComputeFields(int julianDay)
handleComputeFields
in class Calendar
@Deprecated public String getType()
See type="old type name" for the calendar attribute of locale IDs at http://www.unicode.org/reports/tr35/#Key_Type_Definitions
Copyright © 2016 Unicode, Inc. and others.