OffsetDateTime.withOffsetSameLocal

Returns a copy of this {@code OffsetDateTime} with the specified offset ensuring that the result has the same local date-time. !(p) This method returns an object with the same {@code LocalDateTime} and the specified {@code ZoneOffset}. No calculation is needed or performed. For example, if this time represents {@code 2007-12-03T10:30+02:00} and the offset specified is {@code +03:00}, then this method will return {@code 2007-12-03T10:30+03:00}. !(p) To take into account the difference between the offsets, and adjust the time fields, use {@link #withOffsetSameInstant}. !(p) This instance is immutable and unaffected by this method call.

@param offset the zone offset to change to, not null @return an {@code OffsetDateTime} based on this date-time with the requested offset, not null

class OffsetDateTime
withOffsetSameLocal

Meta