public final class Instant extends Object implements Comparable<Instant>, TemporalAccessor
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Instant other) |
boolean |
equals(Object obj) |
long |
getEpochSecond() |
int |
getNano() |
int |
hashCode() |
Instant |
minusMillis(long millisToSubtract) |
Instant |
minusSeconds(long secondsToSubtract) |
static Instant |
now() |
static Instant |
ofEpochMilli(long epochMilli) |
static Instant |
ofEpochSecond(long epochSecond) |
static Instant |
ofEpochSecond(long epochSecond,
long nanoAdjustment) |
static Instant |
parse(CharSequence text) |
Instant |
plusMillis(long millisToAdd) |
Instant |
plusSeconds(long secondsToAdd) |
long |
toEpochMilli() |
String |
toString() |
public static Instant now()
public static Instant ofEpochMilli(long epochMilli)
public static Instant ofEpochSecond(long epochSecond)
public static Instant ofEpochSecond(long epochSecond, long nanoAdjustment)
public static Instant parse(CharSequence text)
public long getEpochSecond()
public int getNano()
public long toEpochMilli()
public Instant plusSeconds(long secondsToAdd)
public Instant plusMillis(long millisToAdd)
public Instant minusSeconds(long secondsToSubtract)
public Instant minusMillis(long millisToSubtract)
public int compareTo(Instant other)
compareTo in interface Comparable<Instant>Copyright © 2026. All rights reserved.