LocalDateTime MAX example

Description

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

This is the local date-time just before midnight at the end of the maximum date.

Syntax

MAX has the following syntax.


public static final LocalDateTime MAX

Example

The following example shows how to use MAX.


import java.time.LocalDateTime;
/*from  w w  w  .  j av a  2  s  .  c o  m*/
public class Main {
  public static void main(String[] args) {
    LocalDateTime a = LocalDateTime.MAX;
    
    System.out.println(a);
  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset