class Instant
source · line 22public class Instant private constructor(
/**
* Whole seconds since 1970-01-01T00:00:00Z, rounded toward negative infinity.
*/
public val epochSeconds: Long,
/**
* The nonnegative fractional nanoseconds within the epoch second.
*/
public val nanosecondsOfSecond: Int) : Equals<Instant>, Compare<Instant>, Hash, ToString, Add<Duration, Instant>, Sub<Duration, Instant>
- Supertype
Equals<Instant> - Supertype
Compare<Instant> - Supertype
Hash - Supertype
ToString - Supertype
Add<Duration, Instant> - Supertype
Sub<Duration, Instant>
An absolute point on the Unix timeline at nanosecond precision. The supported range corresponds to LocalDate.MIN through LocalDate.MAX in UTC.
function toString
source · line 81public override fun toString(): String
- Overrides
toString
Formats this instant in UTC with a trailing Z.
function hash
source · line 46public override fun hash(): Long
- Overrides
hash
Computes a hash consistent with component equality.
function minus
source · line 60public operator fun minus(other: Instant): Duration
Subtracts an elapsed duration, or returns the signed elapsed duration from another instant to this one.
parameter other
source · line 60other: Instant
function compareTo
source · line 40public override operator fun compareTo(other: Instant): Long
- Overrides
compareTo
Orders values by their chronological or numeric value; only the result sign is significant.
parameter other
source · line 40other: Instant
function toEpochMilliseconds
source · line 67public fun toEpochMilliseconds(): Long
Returns epoch milliseconds rounded toward negative infinity; overflow throws ArithmeticException.
function plus
source · line 50public override operator fun plus(other: Duration): Instant
- Overrides
plus
Advances by an elapsed duration, rejecting results outside the supported range.
parameter other
source · line 50other: Duration
function equals
source · line 35public override operator fun equals(other: Instant): Boolean
- Overrides
equals
Compares the stored value components for equality.
parameter other
source · line 35other: Instant
property nanosecondsOfSecond
source · line 30public val nanosecondsOfSecond: Int
get: public read-only
The nonnegative fractional nanoseconds within the epoch second.
function minus
source · line 55public override operator fun minus(other: Duration): Instant
- Overrides
minus
Subtracts an elapsed duration, or returns the signed elapsed duration from another instant to this one.
parameter other
source · line 55other: Duration
property epochSeconds
source · line 26public val epochSeconds: Long
get: public read-only
Whole seconds since 1970-01-01T00:00:00Z, rounded toward negative infinity.
function toLocalDateTime
source · line 71public fun toLocalDateTime(offset: UtcOffset): LocalDateTime
Converts to local calendar fields at the supplied fixed UTC offset; unsupported dates throw.
parameter offset
source · line 71offset: UtcOffset