Partager via


TemporalQueries.Chronology Method

Definition

A query for the Chronology.

[Android.Runtime.Register("chronology", "()Ljava/time/temporal/TemporalQuery;", "", ApiSince=26)]
public static Java.Time.Temporal.ITemporalQuery? Chronology ();
[<Android.Runtime.Register("chronology", "()Ljava/time/temporal/TemporalQuery;", "", ApiSince=26)>]
static member Chronology : unit -> Java.Time.Temporal.ITemporalQuery

Returns

a query that can obtain the chronology of a temporal, not null

Attributes

Remarks

A query for the Chronology.

This queries a TemporalAccessor for the chronology. If the target TemporalAccessor represents a date, or part of a date, then it should return the chronology that the date is expressed in. As a result of this definition, objects only representing time, such as LocalTime, will return null.

The result from JDK classes implementing TemporalAccessor is as follows:<br> LocalDate returns IsoChronology.INSTANCE<br> LocalTime returns null (does not represent a date)<br> LocalDateTime returns IsoChronology.INSTANCE<br> ZonedDateTime returns IsoChronology.INSTANCE<br> OffsetTime returns null (does not represent a date)<br> OffsetDateTime returns IsoChronology.INSTANCE<br> ChronoLocalDate returns the associated chronology<br> ChronoLocalDateTime returns the associated chronology<br> ChronoZonedDateTime returns the associated chronology<br> Era returns the associated chronology<br> DayOfWeek returns null (shared across chronologies)<br> Month returns IsoChronology.INSTANCE<br> Year returns IsoChronology.INSTANCE<br> YearMonth returns IsoChronology.INSTANCE<br> MonthDay returns null IsoChronology.INSTANCE<br> ZoneOffset returns null (does not represent a date)<br> Instant returns null (does not represent a date)<br>

The method java.time.chrono.Chronology#from(TemporalAccessor) can be used as a TemporalQuery via a method reference, Chronology::from. That method is equivalent to this query, except that it throws an exception if a chronology cannot be obtained.

Java documentation for java.time.temporal.TemporalQueries.chronology().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to