Clock.WithZone(ZoneId) Method

Definition

Returns a copy of this clock with a different time-zone.

[Android.Runtime.Register("withZone", "(Ljava/time/ZoneId;)Ljava/time/Clock;", "GetWithZone_Ljava_time_ZoneId_Handler", ApiSince=26)]
public virtual Java.Time.Clock? WithZone(Java.Time.ZoneId? zone);
[<Android.Runtime.Register("withZone", "(Ljava/time/ZoneId;)Ljava/time/Clock;", "GetWithZone_Ljava_time_ZoneId_Handler", ApiSince=26)>]
abstract member WithZone : Java.Time.ZoneId -> Java.Time.Clock
override this.WithZone : Java.Time.ZoneId -> Java.Time.Clock

Parameters

zone
ZoneId

the time-zone to change to, not null

Returns

a clock based on this clock with the specified time-zone, not null

Implements

Attributes

Remarks

Returns a copy of this clock with a different time-zone. A clock will typically obtain the current instant and then convert that to a date or time using a time-zone. This method returns a clock with similar properties but using a different time-zone.

Java reference for java.time.Clock.withZone.

Applies to