Share via


ZoneOffset.From(ITemporalAccessor) Method

Definition

Obtains an instance of ZoneOffset from a temporal object.

[Android.Runtime.Register("from", "(Ljava/time/temporal/TemporalAccessor;)Ljava/time/ZoneOffset;", "", ApiSince=26)]
public static Java.Time.ZoneOffset? From (Java.Time.Temporal.ITemporalAccessor? temporal);
[<Android.Runtime.Register("from", "(Ljava/time/temporal/TemporalAccessor;)Ljava/time/ZoneOffset;", "", ApiSince=26)>]
static member From : Java.Time.Temporal.ITemporalAccessor -> Java.Time.ZoneOffset

Parameters

temporal
ITemporalAccessor

the temporal object to convert, not null

Returns

the zone-offset, not null

Attributes

Remarks

Obtains an instance of ZoneOffset from a temporal object.

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

A TemporalAccessor represents some form of date and time information. This factory converts the arbitrary temporal object to an instance of ZoneOffset.

The conversion uses the TemporalQueries#offset() query, which relies on extracting the ChronoField#OFFSET_SECONDS OFFSET_SECONDS field.

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

Java documentation for java.time.ZoneOffset.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