Language

OffsetDateTime.OfInstant(Instant, ZoneId) Method

Definition

Obtains an instance of OffsetDateTime from an Instant and zone ID.

[Android.Runtime.Register("ofInstant", "(Ljava/time/Instant;Ljava/time/ZoneId;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public static Java.Time.OffsetDateTime? OfInstant(Java.Time.Instant? instant, Java.Time.ZoneId? zone);
[<Android.Runtime.Register("ofInstant", "(Ljava/time/Instant;Ljava/time/ZoneId;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
static member OfInstant : Java.Time.Instant * Java.Time.ZoneId -> Java.Time.OffsetDateTime

Parameters

instant
Instant

the instant to create the date-time from, not null

zone
ZoneId

the time-zone, which may be an offset, not null

Returns

the offset date-time, not null

Attributes

Remarks

Obtains an instance of OffsetDateTime from an Instant and zone ID. This creates an offset date-time with the same instant as that specified. Finding the offset from UTC/Greenwich is simple as there is only one valid offset for each instant.

Java reference for java.time.OffsetDateTime.ofInstant.

Applies to