Added in API level 26

HijrahChronology

class HijrahChronology : AbstractChronology, Serializable
kotlin.Any
   ↳ java.time.chrono.AbstractChronology
   ↳ java.time.chrono.HijrahChronology

The Hijrah calendar is a lunar calendar supporting Islamic calendars.

The HijrahChronology follows the rules of the Hijrah calendar system. The Hijrah calendar has several variants based on differences in when the new moon is determined to have occurred and where the observation is made. In some variants the length of each month is computed algorithmically from the astronomical data for the moon and earth and in others the length of the month is determined by an authorized sighting of the new moon. For the algorithmically based calendars the calendar can project into the future. For sighting based calendars only historical data from past sightings is available.

The length of each month is 29 or 30 days. Ordinary years have 354 days; leap years have 355 days.

CLDR and LDML identify variants:

Variants of Hijrah Calendars
Chronology ID Calendar Type Locale extension, see java.util.Locale Description
Hijrah-umalqura islamic-umalqura ca-islamic-umalqura Islamic - Umm Al-Qura calendar of Saudi Arabia

Additional variants may be available through Chronology#getAvailableChronologies().

Example

Selecting the chronology from the locale uses Chronology#ofLocale to find the Chronology based on Locale supported BCP 47 extension mechanism to request a specific calendar ("ca"). For example,

Locale locale = Locale.forLanguageTag("en-US-u-ca-islamic-umalqura");
       Chronology chrono = Chronology.ofLocale(locale);
  

Summary

Public methods
HijrahDate!
date(era: Era!, yearOfEra: Int, month: Int, dayOfMonth: Int)

Obtains a local date in Hijrah calendar system from the era, year-of-era, month-of-year and day-of-month fields.

HijrahDate!
date(prolepticYear: Int, month: Int, dayOfMonth: Int)

Obtains a local date in Hijrah calendar system from the proleptic-year, month-of-year and day-of-month fields.

HijrahDate!
date(temporal: TemporalAccessor!)

HijrahDate!
dateEpochDay(epochDay: Long)

Obtains a local date in the Hijrah calendar system from the epoch-day.

HijrahDate!

HijrahDate!
dateNow(zone: ZoneId!)

HijrahDate!
dateNow(clock: Clock!)

HijrahDate!
dateYearDay(era: Era!, yearOfEra: Int, dayOfYear: Int)

Obtains a local date in Hijrah calendar system from the era, year-of-era and day-of-year fields.

HijrahDate!
dateYearDay(prolepticYear: Int, dayOfYear: Int)

Obtains a local date in Hijrah calendar system from the proleptic-year and day-of-year fields.

HijrahEra!
eraOf(eraValue: Int)

Creates the HijrahEra object from the numeric value.

MutableList<Era!>!

String!

Gets the calendar type of the Islamic calendar.

String!

Gets the ID of the chronology.

Boolean
isLeapYear(prolepticYear: Long)

ChronoLocalDateTime<HijrahDate!>!

Int
prolepticYear(era: Era!, yearOfEra: Int)

ValueRange!
range(field: ChronoField!)

HijrahDate!
resolveDate(fieldValues: MutableMap<TemporalField!, Long!>!, resolverStyle: ResolverStyle!)

ChronoZonedDateTime<HijrahDate!>!

ChronoZonedDateTime<HijrahDate!>!
zonedDateTime(instant: Instant!, zone: ZoneId!)

Inherited functions
Properties
static HijrahChronology!

Singleton instance of the Islamic Umm Al-Qura calendar of Saudi Arabia.

Public methods

date

Added in API level 26
fun date(
    era: Era!,
    yearOfEra: Int,
    month: Int,
    dayOfMonth: Int
): HijrahDate!

Obtains a local date in Hijrah calendar system from the era, year-of-era, month-of-year and day-of-month fields.

Parameters
era Era!: the Hijrah era, not null
yearOfEra Int: the year-of-era
month Int: the month-of-year
dayOfMonth Int: the day-of-month
Return
HijrahDate! the Hijrah local date, not null
Exceptions
java.time.DateTimeException if unable to create the date
java.lang.ClassCastException if the era is not a HijrahEra

date

Added in API level 26
fun date(
    prolepticYear: Int,
    month: Int,
    dayOfMonth: Int
): HijrahDate!

Obtains a local date in Hijrah calendar system from the proleptic-year, month-of-year and day-of-month fields.

Parameters
prolepticYear Int: the proleptic-year
month Int: the month-of-year
dayOfMonth Int: the day-of-month
Return
HijrahDate! the Hijrah local date, not null
Exceptions
java.time.DateTimeException if unable to create the date

date

Added in API level 26
fun date(temporal: TemporalAccessor!): HijrahDate!
Parameters
temporal TemporalAccessor!: the temporal object to convert, not null
Return
HijrahDate! the local date in this chronology, not null
Exceptions
java.time.DateTimeException if unable to create the date

dateEpochDay

Added in API level 26
fun dateEpochDay(epochDay: Long): HijrahDate!

Obtains a local date in the Hijrah calendar system from the epoch-day.

Parameters
epochDay Long: the epoch day
Return
HijrahDate! the Hijrah local date, not null
Exceptions
java.time.DateTimeException if unable to create the date

dateNow

Added in API level 26
fun dateNow(): HijrahDate!
Return
HijrahDate! the current local date using the system clock and default time-zone, not null
Exceptions
java.time.DateTimeException if unable to create the date

dateNow

Added in API level 26
fun dateNow(zone: ZoneId!): HijrahDate!
Parameters
zone ZoneId!: the zone ID to use, not null
Return
HijrahDate! the current local date using the system clock, not null
Exceptions
java.time.DateTimeException if unable to create the date

dateNow

Added in API level 26
fun dateNow(clock: Clock!): HijrahDate!
Parameters
clock Clock!: the clock to use, not null
Return
HijrahDate! the current local date, not null
Exceptions
java.time.DateTimeException if unable to create the date

dateYearDay

Added in API level 26
fun dateYearDay(
    era: Era!,
    yearOfEra: Int,
    dayOfYear: Int
): HijrahDate!

Obtains a local date in Hijrah calendar system from the era, year-of-era and day-of-year fields.

Parameters
era Era!: the Hijrah era, not null
yearOfEra Int: the year-of-era
dayOfYear Int: the day-of-year
Return
HijrahDate! the Hijrah local date, not null
Exceptions
java.time.DateTimeException if unable to create the date
java.lang.ClassCastException if the era is not a HijrahEra

dateYearDay

Added in API level 26
fun dateYearDay(
    prolepticYear: Int,
    dayOfYear: Int
): HijrahDate!

Obtains a local date in Hijrah calendar system from the proleptic-year and day-of-year fields.

Parameters
prolepticYear Int: the proleptic-year
dayOfYear Int: the day-of-year
Return
HijrahDate! the Hijrah local date, not null
Exceptions
java.time.DateTimeException if the value of the year is out of range, or if the day-of-year is invalid for the year

eraOf

Added in API level 26
fun eraOf(eraValue: Int): HijrahEra!

Creates the HijrahEra object from the numeric value. The Hijrah calendar system has only one era covering the proleptic years greater than zero. This method returns the singleton HijrahEra for the value 1.

Parameters
eraValue Int: the era value
Return
HijrahEra! the calendar system era, not null
Exceptions
java.time.DateTimeException if unable to create the era

eras

Added in API level 26
fun eras(): MutableList<Era!>!
Return
MutableList<Era!>! the list of eras for the chronology, may be immutable, not null

getCalendarType

Added in API level 26
fun getCalendarType(): String!

Gets the calendar type of the Islamic calendar.

The calendar type is an identifier defined by the Unicode Locale Data Markup Language (LDML) specification. It can be used to lookup the Chronology using Chronology#of(String).

Return
String! the calendar system type; non-null if the calendar has a standard type, otherwise null

See Also

getId

Added in API level 26
fun getId(): String!

Gets the ID of the chronology.

The ID uniquely identifies the Chronology. It can be used to lookup the Chronology using Chronology#of(String).

Return
String! the chronology ID, non-null

isLeapYear

Added in API level 26
fun isLeapYear(prolepticYear: Long): Boolean
Parameters
prolepticYear Long: the proleptic-year to check, not validated for range
Return
Boolean true if the year is a leap year

localDateTime

Added in API level 26
fun localDateTime(temporal: TemporalAccessor!): ChronoLocalDateTime<HijrahDate!>!
Parameters
temporal TemporalAccessor!: the temporal object to convert, not null
Return
ChronoLocalDateTime<HijrahDate!>! the local date-time in this chronology, not null
Exceptions
java.time.DateTimeException if unable to create the date-time

prolepticYear

Added in API level 26
fun prolepticYear(
    era: Era!,
    yearOfEra: Int
): Int
Parameters
era Era!: the era of the correct type for the chronology, not null
yearOfEra Int: the chronology year-of-era
Return
Int the proleptic-year
Exceptions
java.time.DateTimeException if unable to convert to a proleptic-year, such as if the year is invalid for the era
java.lang.ClassCastException if the era is not of the correct type for the chronology

range

Added in API level 26
fun range(field: ChronoField!): ValueRange!
Parameters
field ChronoField!: the field to get the range for, not null
Return
ValueRange! the range of valid values for the field, not null
Exceptions
java.time.DateTimeException if the range for the field cannot be obtained

resolveDate

Added in API level 26
fun resolveDate(
    fieldValues: MutableMap<TemporalField!, Long!>!,
    resolverStyle: ResolverStyle!
): HijrahDate!
Parameters
fieldValues MutableMap<TemporalField!, Long!>!: the map of fields to values, which can be updated, not null
resolverStyle ResolverStyle!: the requested type of resolve, not null
Return
HijrahDate! the resolved date, null if insufficient information to create a date
Exceptions
java.time.DateTimeException if the date cannot be resolved, typically because of a conflict in the input data

zonedDateTime

Added in API level 26
fun zonedDateTime(temporal: TemporalAccessor!): ChronoZonedDateTime<HijrahDate!>!
Parameters
temporal TemporalAccessor!: the temporal object to convert, not null
Return
ChronoZonedDateTime<HijrahDate!>! the zoned date-time in this chronology, not null
Exceptions
java.time.DateTimeException if unable to create the date-time

zonedDateTime

Added in API level 26
fun zonedDateTime(
    instant: Instant!,
    zone: ZoneId!
): ChronoZonedDateTime<HijrahDate!>!
Parameters
instant Instant!: the instant to create the date-time from, not null
zone ZoneId!: the time-zone, not null
Return
ChronoZonedDateTime<HijrahDate!>! the zoned date-time, not null
Exceptions
java.time.DateTimeException if the result exceeds the supported range

Properties

INSTANCE

Added in API level 26
static val INSTANCE: HijrahChronology!

Singleton instance of the Islamic Umm Al-Qura calendar of Saudi Arabia. Other Hijrah chronology variants may be available from Chronology#getAvailableChronologies.