Java Date Time - ZonedDateTime withLaterOffsetAtOverlap() example








ZonedDateTime withLaterOffsetAtOverlap() returns a copy of this date-time changing the zone offset to the later of the two valid offsets at a local time-line overlap.

Syntax

withLaterOffsetAtOverlap has the following syntax.

public ZonedDateTime withLaterOffsetAtOverlap()

Example

The following example shows how to use withLaterOffsetAtOverlap.

import java.time.ZonedDateTime;

public class Main {
  public static void main(String[] args) {
    ZonedDateTime dateTime =ZonedDateTime.now();
    ZonedDateTime l =dateTime.withLaterOffsetAtOverlap() ;
    System.out.println(l);
  } 
}

The code above generates the following result.