Clock

interface 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.

See also

Functions

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

Reads the current Instant.

readMilliseconds
Link copied to clipboard
common
abstract fun readMilliseconds(): Milliseconds

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

readPlatformInstant
Link copied to clipboard
common
abstract fun readPlatformInstant(): PlatformInstant

Reads the current PlatformInstant.

Properties

zone
Link copied to clipboard
common
abstract val zone: TimeZone

The time zone of this clock.

Inheritors

FixedClock
Link copied to clipboard
SystemClock
Link copied to clipboard