Returns a copy of this ZonedDateTime
with the nano-of-second altered.
This operates on the local time-line,
changing the time of the local date-time.
This is then converted back to a ZonedDateTime
, using the zone ID
to obtain the offset.
When converting back to ZonedDateTime
, if the local date-time is in an overlap,
then the offset will be retained if possible, otherwise the earlier offset will be used.
If in a gap, the local date-time will be adjusted forward by the length of the gap.
This instance is immutable and unaffected by this method call.
nanoOfSecond | the nano-of-second to set in the result, from 0 to 999,999,999 |
ZonedDateTime
based on this date-time with the requested nanosecond, not null
DateTimeException | if the nano value is invalid |
Diagram: ZonedDateTime