Language

ZonedDateTime.IChronoZonedDateTime.WithZoneSameInstant(ZoneId) Method

Definition

Returns a copy of this date-time with a different time-zone, retaining the instant.

Java.Time.Chrono.IChronoZonedDateTime? IChronoZonedDateTime.WithZoneSameInstant(Java.Time.ZoneId? zone);
abstract member Java.Time.Chrono.IChronoZonedDateTime.WithZoneSameInstant : Java.Time.ZoneId -> Java.Time.Chrono.IChronoZonedDateTime
override this.Java.Time.Chrono.IChronoZonedDateTime.WithZoneSameInstant : Java.Time.ZoneId -> Java.Time.Chrono.IChronoZonedDateTime

Parameters

zone
ZoneId

the time-zone to change to, not null

Returns

a ChronoZonedDateTime based on this date-time with the requested zone, not null

Implements

Remarks

Returns a copy of this date-time with a different time-zone, retaining the instant. This method changes the time-zone and retains the instant. This normally results in a change to the local date-time. This method is based on retaining the same instant, thus gaps and overlaps in the local time-line have no effect on the result. To change the offset while keeping the local time, use withZoneSameLocal(ZoneId).

Java reference for java.time.chrono.ChronoZonedDateTime.withZoneSameInstant.

Applies to