core / io.islandtime.clock / Clock

Clock

(iosArm64, iosX64, jvm, macosX64) interface Clock

A time source.

Properties

(iosArm64, iosX64, jvm, macosX64)

zone

The clock's time zone.

abstract val zone: TimeZone

Functions

(iosArm64, iosX64, jvm, macosX64)

instant

Get the current Instant.

open fun instant(): Instant
(iosArm64, iosX64, jvm, macosX64)

read

Get the current number of milliseconds since the Unix epoch of 1970-01-01T00:00 in UTC.

abstract fun read(): LongMilliseconds

Inheritors

(iosArm64, iosX64, jvm, macosX64)

FixedClock

A clock with fixed time, suitable for testing.

class FixedClock : Clock
(iosArm64, iosX64, jvm, macosX64)

SystemClock

A clock that provides the time from the current system.

class SystemClock : Clock