Java java.time Instant fields, constructors, methods, implement or subclass

Example usage for Java java.time Instant fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.time Instant.

The text is from its open source code.

Field

InstantEPOCH
Constant for the 1970-01-01T00:00:00Z epoch instant.
InstantMIN
The minimum supported Instant , '-1000000000-01-01T00:00Z'.
InstantMAX
The maximum supported Instant , '1000000000-12-31T23:59:59.999999999Z'.

Method

TemporaladjustInto(Temporal temporal)
Adjusts the specified temporal object to have this instant.
OffsetDateTimeatOffset(ZoneOffset offset)
Combines this instant with an offset to create an OffsetDateTime .
ZonedDateTimeatZone(ZoneId zone)
Combines this instant with a time-zone to create a ZonedDateTime .
intcompareTo(Instant otherInstant)
Compares this instant to the specified instant.
booleanequals(Object otherInstant)
Checks if this instant is equal to the specified instant.
Instantfrom(TemporalAccessor temporal)
Obtains an instance of Instant from a temporal object.
intget(TemporalField field)
Gets the value of the specified field from this instant as an int .
longgetEpochSecond()
Gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z.
longgetLong(TemporalField field)
Gets the value of the specified field from this instant as a long .
intgetNano()
Gets the number of nanoseconds, later along the time-line, from the start of the second.
inthashCode()
Returns a hash code for this instant.
booleanisAfter(Instant otherInstant)
Checks if this instant is after the specified instant.
booleanisBefore(Instant otherInstant)
Checks if this instant is before the specified instant.
booleanisSupported(TemporalField field)
Checks if the specified field is supported.
booleanisSupported(TemporalUnit unit)
Checks if the specified unit is supported.
Instantminus(long amountToSubtract, TemporalUnit unit)
Returns a copy of this instant with the specified amount subtracted.
Instantminus(TemporalAmount amountToSubtract)
Returns a copy of this instant with the specified amount subtracted.
InstantminusMillis(long millisToSubtract)
Returns a copy of this instant with the specified duration in milliseconds subtracted.
InstantminusNanos(long nanosToSubtract)
Returns a copy of this instant with the specified duration in nanoseconds subtracted.
InstantminusSeconds(long secondsToSubtract)
Returns a copy of this instant with the specified duration in seconds subtracted.
Instantnow()
Obtains the current instant from the system clock.
Instantnow(Clock clock)
Obtains the current instant from the specified clock.
InstantofEpochMilli(long epochMilli)
Obtains an instance of Instant using milliseconds from the epoch of 1970-01-01T00:00:00Z.
InstantofEpochSecond(long epochSecond, long nanoAdjustment)
Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z and nanosecond fraction of second.
InstantofEpochSecond(long epochSecond)
Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z.
Instantparse(final CharSequence text)
Obtains an instance of Instant from a text string such as 2007-12-03T10:15:30.00Z .
Instantplus(TemporalAmount amountToAdd)
Returns a copy of this instant with the specified amount added.
Instantplus(long amountToAdd, TemporalUnit unit)
Returns a copy of this instant with the specified amount added.
Instantplus(long secondsToAdd, long nanosToAdd)
Returns a copy of this instant with the specified duration added.
InstantplusMillis(long millisToAdd)
Returns a copy of this instant with the specified duration in milliseconds added.
InstantplusNanos(long nanosToAdd)
Returns a copy of this instant with the specified duration in nanoseconds added.
InstantplusSeconds(long secondsToAdd)
Returns a copy of this instant with the specified duration in seconds added.
Rquery(TemporalQuery query)
Queries this instant using the specified query.
ValueRangerange(TemporalField field)
Gets the range of valid values for the specified field.
longtoEpochMilli()
Converts this instant to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z.
StringtoString()
A string representation of this instant using ISO-8601 representation.
InstanttruncatedTo(TemporalUnit unit)
Returns a copy of this Instant truncated to the specified unit.
longuntil(Temporal endExclusive, TemporalUnit unit)
Calculates the amount of time until another instant in terms of the specified unit.
Instantwith(TemporalField field, long newValue)
Returns a copy of this instant with the specified field set to a new value.