Instant MAX example

Description

Instant MAX defines the maximum supported Instant, '1000000000-12-31T23:59:59.999999999Z' is the value.

Syntax

MAX has the following syntax.


public static final Instant MAX

Example

The following example shows how to use MAX.


import java.time.Instant;
//from   ww  w.ja va  2s  .co m
public class Main {
  public static void main(String[] args) {
    Instant instant = Instant.MAX;
    System.out.println(instant.getEpochSecond());
    
  }
}

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