GeezerVison is showing docs.oracle.com — Chronology (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
compact1, compact2, compact3
java.time.chrono
Interface Chronology
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods
| Modifier and Type |
Method |
Description |
int |
compareTo(Chronology other) |
Compares this chronology to another chronology.
|
default ChronoLocalDate |
date(Era era,
int yearOfEra,
int month,
int dayOfMonth) |
Obtains a local date in this chronology from the era, year-of-era,
month-of-year and day-of-month fields.
|
ChronoLocalDate |
date(int prolepticYear,
int month,
int dayOfMonth) |
Obtains a local date in this chronology from the proleptic-year,
month-of-year and day-of-month fields.
|
ChronoLocalDate |
date(TemporalAccessor temporal) |
Obtains a local date in this chronology from another temporal object.
|
ChronoLocalDate |
dateEpochDay(long epochDay) |
Obtains a local date in this chronology from the epoch-day.
|
default ChronoLocalDate |
dateNow() |
Obtains the current local date in this chronology from the system clock in the default time-zone.
|
default ChronoLocalDate |
dateNow(Clock clock) |
Obtains the current local date in this chronology from the specified clock.
|
default ChronoLocalDate |
dateNow(ZoneId zone) |
Obtains the current local date in this chronology from the system clock in the specified time-zone.
|
default ChronoLocalDate |
dateYearDay(Era era,
int yearOfEra,
int dayOfYear) |
Obtains a local date in this chronology from the era, year-of-era and
day-of-year fields.
|
ChronoLocalDate |
dateYearDay(int prolepticYear,
int dayOfYear) |
Obtains a local date in this chronology from the proleptic-year and
day-of-year fields.
|
boolean |
equals(Object obj) |
Checks if this chronology is equal to another chronology.
|
Era |
eraOf(int eraValue) |
Creates the chronology era object from the numeric value.
|
List<Era> |
eras() |
Gets the list of eras for the chronology.
|
static Chronology |
from(TemporalAccessor temporal) |
Obtains an instance of Chronology from a temporal object.
|
static Set<Chronology> |
getAvailableChronologies() |
Returns the available chronologies.
|
String |
getCalendarType() |
Gets the calendar type of the calendar system.
|
default String |
getDisplayName(TextStyle style,
Locale locale) |
Gets the textual representation of this chronology.
|
String |
getId() |
Gets the ID of the chronology.
|
int |
hashCode() |
A hash code for this chronology.
|
boolean |
isLeapYear(long prolepticYear) |
Checks if the specified year is a leap year.
|
default ChronoLocalDateTime<? extends ChronoLocalDate> |
localDateTime(TemporalAccessor temporal) |
Obtains a local date-time in this chronology from another temporal object.
|
static Chronology |
of(String id) |
Obtains an instance of Chronology from a chronology ID or
calendar system type.
|
static Chronology |
ofLocale(Locale locale) |
Obtains an instance of Chronology from a locale.
|
default ChronoPeriod |
period(int years,
int months,
int days) |
Obtains a period for this chronology based on years, months and days.
|
int |
prolepticYear(Era era,
int yearOfEra) |
Calculates the proleptic-year given the era and year-of-era.
|
ValueRange |
range(ChronoField field) |
Gets the range of valid values for the specified field.
|
ChronoLocalDate |
resolveDate(Map<TemporalField,Long> fieldValues,
ResolverStyle resolverStyle) |
Resolves parsed ChronoField values into a date during parsing.
|
String |
toString() |
Outputs this chronology as a String.
|
default ChronoZonedDateTime<? extends ChronoLocalDate> |
zonedDateTime(Instant instant,
ZoneId zone) |
Obtains a ChronoZonedDateTime in this chronology from an Instant.
|
default ChronoZonedDateTime<? extends ChronoLocalDate> |
zonedDateTime(TemporalAccessor temporal) |
Obtains a ChronoZonedDateTime in this chronology from another temporal object.
|
-
-
Method Detail
-
getId
String getId()
Gets the ID of the chronology.
The ID uniquely identifies the Chronology.
It can be used to lookup the Chronology using of(String).
- Returns:
- the chronology ID, not null
- See Also:
getCalendarType()
-
getCalendarType
String getCalendarType()
Gets the calendar type of the calendar system.
The calendar type is an identifier defined by the CLDR and
Unicode Locale Data Markup Language (LDML) specifications
to uniquely identification a calendar.
The getCalendarType is the concatenation of the CLDR calendar type
and the variant, if applicable, is appended separated by "-".
The calendar type is used to lookup the Chronology using of(String).
- Returns:
- the calendar system type, null if the calendar is not defined by CLDR/LDML
- See Also:
getId()
-
date
default ChronoLocalDate date(Era era,
int yearOfEra,
int month,
int dayOfMonth)
Obtains a local date in this chronology from the era, year-of-era,
month-of-year and day-of-month fields.
- Implementation Requirements:
- The default implementation combines the era and year-of-era into a proleptic
year before calling
date(int, int, int).
- Parameters:
era - the era of the correct type for the chronology, not null
yearOfEra - the chronology year-of-era
month - the chronology month-of-year
dayOfMonth - the chronology day-of-month
- Returns:
- the local date in this chronology, not null
- Throws:
DateTimeException - if unable to create the date
ClassCastException - if the era is not of the correct type for the chronology
-
date
ChronoLocalDate date(int prolepticYear,
int month,
int dayOfMonth)
Obtains a local date in this chronology from the proleptic-year,
month-of-year and day-of-month fields.
- Parameters:
prolepticYear - the chronology proleptic-year
month - the chronology month-of-year
dayOfMonth - the chronology day-of-month
- Returns:
- the local date in this chronology, not null
- Throws:
DateTimeException - if unable to create the date
-
dateYearDay
default ChronoLocalDate dateYearDay(Era era,
int yearOfEra,
int dayOfYear)
Obtains a local date in this chronology from the era, year-of-era and
day-of-year fields.
- Implementation Requirements:
- The default implementation combines the era and year-of-era into a proleptic
year before calling
dateYearDay(int, int).
- Parameters:
era - the era of the correct type for the chronology, not null
yearOfEra - the chronology year-of-era
dayOfYear - the chronology day-of-year
- Returns:
- the local date in this chronology, not null
- Throws:
DateTimeException - if unable to create the date
ClassCastException - if the era is not of the correct type for the chronology
-
dateYearDay
ChronoLocalDate dateYearDay(int prolepticYear,
int dayOfYear)
Obtains a local date in this chronology from the proleptic-year and
day-of-year fields.
- Parameters:
prolepticYear - the chronology proleptic-year
dayOfYear - the chronology day-of-year
- Returns:
- the local date in this chronology, not null
- Throws:
DateTimeException - if unable to create the date
-
eraOf
Era eraOf(int eraValue)
Creates the chronology era object from the numeric value.
The era is, conceptually, the largest division of the time-line.
Most calendar systems have a single epoch dividing the time-line into two eras.
However, some have multiple eras, such as one for the reign of each leader.
The exact meaning is determined by the chronology according to the following constraints.
The era in use at 1970-01-01 must have the value 1.
Later eras must have sequentially higher values.
Earlier eras must have sequentially lower values.
Each chronology must refer to an enum or similar singleton to provide the era values.
This method returns the singleton era of the correct type for the specified era value.
- Parameters:
eraValue - the era value
- Returns:
- the calendar system era, not null
- Throws:
DateTimeException - if unable to create the era
-
eras
List<Era> eras()
Gets the list of eras for the chronology.
Most calendar systems have an era, within which the year has meaning.
If the calendar system does not support the concept of eras, an empty
list must be returned.
- Returns:
- the list of eras for the chronology, may be immutable, not null
-
toString
String toString()
Outputs this chronology as a String.
The format should include the entire state of the object.
- Overrides:
toString in class Object
- Returns:
- a string representation of this chronology, not null
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|