Language

LocalTime.OfInstant(Instant, ZoneId) Method

Definition

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

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

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 local time, not null

Attributes

Remarks

Obtains an instance of LocalTime from an Instant and zone ID. This creates a local time based on the specified instant. First, the offset from UTC/Greenwich is obtained using the zone ID and instant, which is simple as there is only one valid offset for each instant. Then, the instant and offset are used to calculate the local time.

Java reference for java.time.LocalTime.ofInstant.

Applies to