Freigeben über


ChronoLocalDateTime.From(ITemporalAccessor) Method

Definition

Caution

Use 'Java.Time.Chrono.IChronoLocalDateTime.From'. This class will be removed in a future release.

Obtains an instance of ChronoLocalDateTime from a temporal object.

[Android.Runtime.Register("from", "(Ljava/time/temporal/TemporalAccessor;)Ljava/time/chrono/ChronoLocalDateTime;", "", ApiSince=26)]
[System.Obsolete("Use 'Java.Time.Chrono.IChronoLocalDateTime.From'. This class will be removed in a future release.")]
public static Java.Time.Chrono.IChronoLocalDateTime? From (Java.Time.Temporal.ITemporalAccessor? temporal);
[<Android.Runtime.Register("from", "(Ljava/time/temporal/TemporalAccessor;)Ljava/time/chrono/ChronoLocalDateTime;", "", ApiSince=26)>]
[<System.Obsolete("Use 'Java.Time.Chrono.IChronoLocalDateTime.From'. This class will be removed in a future release.")>]
static member From : Java.Time.Temporal.ITemporalAccessor -> Java.Time.Chrono.IChronoLocalDateTime

Parameters

temporal
ITemporalAccessor

the temporal object to convert, not null

Returns

the date-time, not null

Attributes

Remarks

Obtains an instance of ChronoLocalDateTime from a temporal object.

This obtains a local date-time based on the specified temporal. A TemporalAccessor represents an arbitrary set of date and time information, which this factory converts to an instance of ChronoLocalDateTime.

The conversion extracts and combines the chronology and the date-time from the temporal object. The behavior is equivalent to using Chronology#localDateTime(TemporalAccessor) with the extracted chronology. Implementations are permitted to perform optimizations such as accessing those fields that are equivalent to the relevant objects.

This method matches the signature of the functional interface TemporalQuery allowing it to be used as a query via method reference, ChronoLocalDateTime::from.

Java documentation for java.time.chrono.ChronoLocalDateTime.from(java.time.temporal.TemporalAccessor).

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