Deprecated
This API is ICU internal only.
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
com. passing in a
ULocale with the tag "@calendar=persian".
com.ibm.icu.util.GregorianCalendar , com.ibm.icu.util.Calendar
| Modifier and Type | Field and Description |
|---|---|
| private static final int[][] | |
| private static final int[][] | |
| private static final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | PersianCalendar()
Deprecated
This API is ICU internal only.
Constructs a default PersianCalendar using the current time
in the default time zone with the default FORMAT locale.
|
| public | PersianCalendar(TimeZone
the given time zone. zone)
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar based on the current time
in the given time zone with the default FORMAT locale.
|
| public | PersianCalendar(Locale
the given locale. aLocale)
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar based on the current time
in the default time zone with the given locale.
|
| public | PersianCalendar(ULocale
the given ulocale. locale)
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar based on the current time
in the default time zone with the given locale.
|
| public | PersianCalendar(TimeZone
the given time zone. zone, Locale the given locale. aLocale)
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar based on the current time
in the given time zone with the given locale.
|
| public | PersianCalendar(TimeZone
the given time zone. zone, ULocale the given ulocale. locale)
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar based on the current time
in the given time zone with the given locale.
|
| public | PersianCalendar(Date
The date to which the new calendar is set. date)
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar with the given date set
in the default time zone with the default FORMAT locale.
|
| public | PersianCalendar(int
the value used to set the year, int YEAR time field in the calendar.the value used to set the month, int MONTH time field in the calendar.
Note that the month value is 0-based. e.g., 0 for Farvardin.the value used to set the date)DATE time field in the calendar.
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar with the given date set
in the default time zone with the default FORMAT locale.
|
| public | PersianCalendar(int
the value used to set the year, int YEAR time field in the calendar.the value used to set the month, int MONTH time field in the calendar.
Note that the month value is 0-based. e.g., 0 for Farvardin.the value used to set the date, int DATE time field in the calendar.the value used to set the hour, int HOUR_OF_DAY time field
in the calendar.the value used to set the minute, int MINUTE time field
in the calendar.the value used to set the second)SECOND time field
in the calendar.
Deprecated
This API is ICU internal only.
Constructs a PersianCalendar with the given date
and time set for the default time zone with the default FORMAT locale.
|
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| protected void | handleComputeFields(int julianDay)
Overrides com.
Deprecated
This API is ICU internal only.
Override Calendar to compute several fields specific to the Persian
calendar system.
|
| protected int | handleComputeMonthStart(int
the extended year eyear, int the zero-based month, or 0 if useMonth is false month, boolean 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 useMonth)Implements abstract com.
Deprecated
This API is ICU internal only.
Return JD of start of given month/year
|
| protected int | handleGetExtendedYear()
Implements abstract com.
Deprecated
This API is ICU internal only.
Returns the extended year defined by the current fields.
|
| protected int | handleGetLimit(int
one of the above field numbers field, int one of limitType)MINIMUM, GREATEST_MINIMUM,
LEAST_MAXIMUM, or MAXIMUMImplements abstract com.
Deprecated
This API is ICU internal only.
Subclass API for defining limits of different types.
|
| protected int | handleGetMonthLength(int
The Persian year extendedYear, int The Persian month, 0-based month)Overrides com.
Deprecated
This API is ICU internal only.
Return the length (in days) of the given month.
|
| protected int | handleGetYearLength(int extendedYear)
Overrides com.
Deprecated
This API is ICU internal only.
Return the number of days in the given Persian year
|
| private static final boolean |
| LIMITS | back to summary |
|---|---|
| private static final int[][] LIMITS | |
| MONTH_COUNT | back to summary |
|---|---|
| private static final int[][] MONTH_COUNT | |
| PERSIAN_EPOCH | back to summary |
|---|---|
| private static final int PERSIAN_EPOCH | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar()
Deprecated This API is ICU internal only. Constructs a default
| |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(TimeZone zone)
Deprecated This API is ICU internal only. Constructs a
| |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(Locale aLocale)
Deprecated This API is ICU internal only. Constructs a | |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(ULocale locale)
Deprecated This API is ICU internal only. Constructs a | |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(TimeZone zone, Locale aLocale)
Deprecated This API is ICU internal only. Constructs a
| |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(TimeZone zone, ULocale locale)
Deprecated This API is ICU internal only. Constructs a
| |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(Date date)
Deprecated This API is ICU internal only. Constructs a
| |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(int year, int month, int date)
Deprecated This API is ICU internal only. Constructs a
| |
| PersianCalendar | back to summary |
|---|---|
| public PersianCalendar(int year, int month, int date, int hour, int minute, int second)
Deprecated This API is ICU internal only. Constructs a
| |
| getType | back to summary |
|---|---|
| public String getType() Overrides com. Doc from com. Deprecated This API is ICU internal only. ICU See type="old type name" for the calendar attribute of locale IDs at http://www.unicode.org/reports/tr35/#Key_Type_Definitions | |
| handleComputeFields | back to summary |
|---|---|
| protected void handleComputeFields(int julianDay) Overrides com. Deprecated This API is ICU internal only. Override Calendar to compute several fields specific to the Persian calendar system. These are:
| |
| handleComputeMonthStart | back to summary |
|---|---|
| protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) Implements abstract com. Deprecated This API is ICU internal only. Return JD of start of given month/year
| |
| handleGetExtendedYear | back to summary |
|---|---|
| protected int handleGetExtendedYear() Implements abstract com. Doc from com. Deprecated This API is ICU internal only. 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.
| |
| handleGetLimit | back to summary |
|---|---|
| protected int handleGetLimit(int field, int limitType) Implements abstract com. Doc from com. Deprecated This API is ICU internal only. Subclass API for defining limits of different types. Subclasses must implement this method to return limits for the following fields: ERA YEAR MONTH WEEK_OF_YEAR WEEK_OF_MONTH DAY_OF_MONTH DAY_OF_YEAR DAY_OF_WEEK_IN_MONTH YEAR_WOY EXTENDED_YEAR
| |
| handleGetMonthLength | back to summary |
|---|---|
| protected int handleGetMonthLength(int extendedYear, int month) Overrides com. Deprecated This API is ICU internal only. Return the length (in days) of the given month.
| |
| handleGetYearLength | back to summary |
|---|---|
| protected int handleGetYearLength(int extendedYear) Overrides com. Deprecated This API is ICU internal only. Return the number of days in the given Persian year
| |
| isLeapYear | back to summary |
|---|---|
| private static final boolean isLeapYear(int year) Determine whether a year is a leap year in the Persian calendar | |