Companion

Since Kotlin

2.1

Properties

Link copied to clipboard

An instant value that is far in the future.

Since Kotlin 2.1
Link copied to clipboard

An instant value that is far in the past.

Since Kotlin 2.1

Functions

Link copied to clipboard
fun fromEpochMilliseconds(epochMilliseconds: Long): Instant

Returns an Instant that is epochMilliseconds number of milliseconds from the epoch instant 1970-01-01T00:00:00Z.

Since Kotlin 2.1
Link copied to clipboard
fun fromEpochSeconds(epochSeconds: Long, nanosecondAdjustment: Int): Instant
fun fromEpochSeconds(epochSeconds: Long, nanosecondAdjustment: Long = 0): Instant

Returns an Instant that is the epochSeconds number of seconds from the epoch instant 1970-01-01T00:00:00Z and the nanosecondAdjustment number of nanoseconds from the whole second.

Since Kotlin 2.1
Link copied to clipboard
fun now(): Instant
Since Kotlin 2.1
Link copied to clipboard

Parses an ISO 8601 string that represents an instant (for example, 2020-08-30T18:43:00Z).

Since Kotlin 2.1