Clock

An abstraction providing the current time.

For an implementation that uses the system's clock, see SystemClock. FixedClock is also available for testing purposes.

interface Clock

See also

FixedClock
Link copied to clipboard

SystemClock
Link copied to clipboard

Functions

equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
readInstant
Link copied to clipboard
common

Reads the current Instant.

abstract fun readInstant(): Instant
readMilliseconds
Link copied to clipboard
common

Reads the current number of milliseconds that have elapsed since the Unix epoch of 1970-01-01T00:00 in UTC.

abstract fun readMilliseconds(): LongMilliseconds
readPlatformInstant
Link copied to clipboard
common

Reads the current PlatformInstant.

abstract fun readPlatformInstant(): PlatformInstant
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

zone
Link copied to clipboard
common

The time zone of this clock.

abstract val zone: TimeZone

Inheritors

FixedClock
Link copied to clipboard
common
SystemClock
Link copied to clipboard
common