Java Date Time - OffsetDateTime MAX example








OffsetDateTime MAX defines the maximum supported OffsetDateTime, '+999999999-12-31T23:59:59.999999999-18:00'.

Syntax

MAX has the following syntax.

public static final OffsetDateTime MAX

Example

The following example shows how to use MAX.

import java.time.OffsetDateTime;

public class Main {
  public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.MAX;
    
    System.out.println(o);
  }
}

The code above generates the following result.