Compares this instant to the specified instant.
The comparison is based on the time-line position of the instants. It is "consistent with equals".
the comparator value, negative if less, positive if greater
the other instant to compare to
Checks if this instant is after the specified instant.
The comparison is based on the time-line position of the instants.
true
if this instant is after the specified instant
the other instant to compare to
Checks if this instant is before the specified instant.
The comparison is based on the time-line position of the instants.
true
if this instant is before the specified instant
the other instant to compare to
Returns a copy of this instant with the specified duration in milliseconds subtracted.
This instance is immutable and unaffected by this method call.
an Instant based on this instant with the specified milliseconds subtracted
DateTimeException
if the result exceeds the maximum or minimum instant
ArithmeticException
if numeric overflow occurs
the milliseconds to subtract, positive or negative
Returns a copy of this instant with the specified duration in nanoseconds subtracted.
This instance is immutable and unaffected by this method call.
an Instant based on this instant with the specified nanoseconds subtracted
DateTimeException
if the result exceeds the maximum or minimum instant
ArithmeticException
if numeric overflow occurs
the nanoseconds to subtract, positive or negative
Returns a copy of this instant with the specified duration in seconds subtracted.
This instance is immutable and unaffected by this method call.
an Instant based on this instant with the specified seconds subtracted
DateTimeException
if the result exceeds the maximum or minimum instant
ArithmeticException
if numeric overflow occurs
the seconds to subtract, positive or negative
Returns a copy of this instant with the specified duration in milliseconds added.
This instance is immutable and unaffected by this method call.
an Instant based on this instant with the specified milliseconds added
DateTimeException
if the result exceeds the maximum or minimum instant
ArithmeticException
if numeric overflow occurs
the milliseconds to add, positive or negative
Returns a copy of this instant with the specified duration in nanoseconds added.
This instance is immutable and unaffected by this method call.
an Instant based on this instant with the specified nanoseconds added
DateTimeException
if the result exceeds the maximum or minimum instant
ArithmeticException
if numeric overflow occurs
the nanoseconds to add, positive or negative
Returns a copy of this instant with the specified duration in seconds added.
This instance is immutable and unaffected by this method call.
an Instant based on this instant with the specified seconds added
DateTimeException
if the result exceeds the maximum or minimum instant
ArithmeticException
if numeric overflow occurs
the seconds to add, positive or negative
Converts this instant to the number of milliseconds from the epoch
of 1970-01-01T00:00:00Z
.
If this instant represents a point on the time-line too far in the future
or past to fit in a long
milliseconds, then an exception is thrown.
If this instant has greater than millisecond precision, then the conversion will drop any excess precision information as though the amount in nanoseconds was subject to integer division by one million.
the number of milliseconds since the epoch of 1970-01-01T00:00:00Z
ArithmeticException
if numeric overflow occurs
A Java Instant.