Language

OffsetTime.OfInstant(Instant, ZoneId) Method

Definition

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

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

Parameters

instant
Instant

the instant to create the time from, not null

zone
ZoneId

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

Returns

the offset time, not null

Attributes

Remarks

Obtains an instance of OffsetTime from an Instant and zone ID. This creates an offset 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. The date component of the instant is dropped during the conversion. This means that the conversion can never fail due to the instant being out of the valid range of dates.

Java reference for java.time.OffsetTime.ofInstant.

Applies to