Added in API level 26

ThaiBuddhistChronology

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

The Thai Buddhist calendar system.

This chronology defines the rules of the Thai Buddhist calendar system. This calendar system is primarily used in Thailand. Dates are aligned such that 2484-01-01 (Buddhist) is 1941-01-01 (ISO).

The fields are defined as follows:

  • era - There are two eras, the current 'Buddhist' (ERA_BE) and the previous era (ERA_BEFORE_BE).
  • year-of-era - The year-of-era for the current era increases uniformly from the epoch at year one. For the previous era the year increases from one as time goes backwards. The value for the current era is equal to the ISO proleptic-year plus 543.
  • proleptic-year - The proleptic year is the same as the year-of-era for the current era. For the previous era, years have zero, then negative values. The value is equal to the ISO proleptic-year plus 543.
  • month-of-year - The ThaiBuddhist month-of-year exactly matches ISO.
  • day-of-month - The ThaiBuddhist day-of-month exactly matches ISO.
  • day-of-year - The ThaiBuddhist day-of-year exactly matches ISO.
  • leap-year - The ThaiBuddhist leap-year pattern exactly matches ISO, such that the two calendars are never out of step.

Summary

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

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

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

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

ThaiBuddhistDate!
date(temporal: TemporalAccessor!)

ThaiBuddhistDate!
dateEpochDay(epochDay: Long)

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

ThaiBuddhistDate!

ThaiBuddhistDate!
dateNow(zone: ZoneId!)

ThaiBuddhistDate!
dateNow(clock: Clock!)

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

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

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

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

ThaiBuddhistEra!
eraOf(eraValue: Int)

MutableList<Era!>!

String!

Gets the calendar type of the underlying calendar system - 'buddhist'.

String!

Gets the ID of the chronology - 'ThaiBuddhist'.

Boolean
isLeapYear(prolepticYear: Long)

Checks if the specified year is a leap year.

ChronoLocalDateTime<ThaiBuddhistDate!>!

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

ValueRange!
range(field: ChronoField!)

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

ChronoZonedDateTime<ThaiBuddhistDate!>!

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

Inherited functions
Properties
static ThaiBuddhistChronology!

Singleton instance of the Buddhist chronology.

Public methods

date

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

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

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

date

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

Obtains a local date in Thai Buddhist 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
ThaiBuddhistDate! the Thai Buddhist local date, not null
Exceptions
java.time.DateTimeException if unable to create the date

date

Added in API level 26
fun date(temporal: TemporalAccessor!): ThaiBuddhistDate!
Parameters
temporal TemporalAccessor!: the temporal object to convert, not null
Return
ThaiBuddhistDate! 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): ThaiBuddhistDate!

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

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

dateNow

Added in API level 26
fun dateNow(): ThaiBuddhistDate!
Return
ThaiBuddhistDate! 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!): ThaiBuddhistDate!
Parameters
zone ZoneId!: the zone ID to use, not null
Return
ThaiBuddhistDate! 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!): ThaiBuddhistDate!
Parameters
clock Clock!: the clock to use, not null
Return
ThaiBuddhistDate! 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
): ThaiBuddhistDate!

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

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

dateYearDay

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

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

Parameters
prolepticYear Int: the proleptic-year
dayOfYear Int: the day-of-year
Return
ThaiBuddhistDate! the Thai Buddhist local date, not null
Exceptions
java.time.DateTimeException if unable to create the date

eraOf

Added in API level 26
fun eraOf(eraValue: Int): ThaiBuddhistEra!
Parameters
eraValue Int: the era value
Return
ThaiBuddhistEra! 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 underlying calendar system - 'buddhist'.

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). It can also be used as part of a locale, accessible via Locale#getUnicodeLocaleType(String) with the key 'ca'.

Return
String! the calendar system type - 'buddhist'

See Also

getId

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

Gets the ID of the chronology - 'ThaiBuddhist'.

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

Return
String! the chronology ID - 'ThaiBuddhist'

isLeapYear

Added in API level 26
fun isLeapYear(prolepticYear: Long): Boolean

Checks if the specified year is a leap year.

Thai Buddhist leap years occur exactly in line with ISO leap years. This method does not validate the year passed in, and only has a well-defined result for years in the supported range.

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<ThaiBuddhistDate!>!
Parameters
temporal TemporalAccessor!: the temporal object to convert, not null
Return
ChronoLocalDateTime<ThaiBuddhistDate!>! 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!
): ThaiBuddhistDate!
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
ThaiBuddhistDate! 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<ThaiBuddhistDate!>!
Parameters
temporal TemporalAccessor!: the temporal object to convert, not null
Return
ChronoZonedDateTime<ThaiBuddhistDate!>! 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<ThaiBuddhistDate!>!
Parameters
instant Instant!: the instant to create the date-time from, not null
zone ZoneId!: the time-zone, not null
Return
ChronoZonedDateTime<ThaiBuddhistDate!>! 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: ThaiBuddhistChronology!

Singleton instance of the Buddhist chronology.