次の方法で共有


TemporalQueries.LocalDate Method

Definition

A query for LocalDate returning null if not found.

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

Returns

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

Attributes

Remarks

A query for LocalDate returning null if not found.

This returns a TemporalQuery that can be used to query a temporal object for the local date. The query will return null if the temporal object cannot supply a local date.

The query implementation examines the ChronoField#EPOCH_DAY EPOCH_DAY field and uses it to create a LocalDate.

The method ZoneOffset#from(TemporalAccessor) can be used as a TemporalQuery via a method reference, LocalDate::from. This query and LocalDate::from will return the same result if the temporal object contains a date. If the temporal object does not contain a date, then the method reference will throw an exception, whereas this query will return null.

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

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