OffsetDateTime.From(ITemporalAccessor) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Obtains an instance of OffsetDateTime from a temporal object.
[Android.Runtime.Register("from", "(Ljava/time/temporal/TemporalAccessor;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public static Java.Time.OffsetDateTime? From(Java.Time.Temporal.ITemporalAccessor? temporal);
[<Android.Runtime.Register("from", "(Ljava/time/temporal/TemporalAccessor;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
static member From : Java.Time.Temporal.ITemporalAccessor -> Java.Time.OffsetDateTime
Parameters
- temporal
- ITemporalAccessor
the temporal object to convert, not null
Returns
the offset date-time, not null
- Attributes
Remarks
Obtains an instance of OffsetDateTime from a temporal object. This obtains an offset 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 OffsetDateTime. The conversion will first obtain a ZoneOffset from the temporal object. It will then try to obtain a LocalDateTime, falling back to an Instant if necessary. The result will be the combination of ZoneOffset with either with LocalDateTime or Instant. 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, OffsetDateTime::from.
Java reference for java.time.OffsetDateTime.from.