OffsetTime.WithOffsetSameLocal(ZoneOffset) Method

Definition

Returns a copy of this OffsetTime with the specified offset ensuring that the result has the same local time.

[Android.Runtime.Register("withOffsetSameLocal", "(Ljava/time/ZoneOffset;)Ljava/time/OffsetTime;", "", ApiSince=26)]
public Java.Time.OffsetTime? WithOffsetSameLocal(Java.Time.ZoneOffset? offset);
[<Android.Runtime.Register("withOffsetSameLocal", "(Ljava/time/ZoneOffset;)Ljava/time/OffsetTime;", "", ApiSince=26)>]
member this.WithOffsetSameLocal : Java.Time.ZoneOffset -> Java.Time.OffsetTime

Parameters

offset
ZoneOffset

the zone offset to change to, not null

Returns

an OffsetTime based on this time with the requested offset, not null

Attributes

Remarks

Returns a copy of this OffsetTime with the specified offset ensuring that the result has the same local time. This method returns an object with the same LocalTime and the specified ZoneOffset. No calculation is needed or performed. For example, if this time represents 10:30+02:00 and the offset specified is +03:00, then this method will return 10:30+03:00. To take into account the difference between the offsets, and adjust the time fields, use withOffsetSameInstant(java.time.ZoneOffset). This instance is immutable and unaffected by this method call.

Java reference for java.time.OffsetTime.withOffsetSameLocal.

Applies to