Clock

interface Clock

A source of Instant values.

See Clock.System for the clock instance that queries the operating system.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
object System : Clock

The Clock instance that queries the operating system as its source of knowledge of time.

Functions

Link copied to clipboard
abstract fun now(): Instant

Returns the Instant corresponding to the current time, according to this clock.

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun Clock.asTimeSource(): TimeSource

Returns a TimeSource that uses this Clock to mark a time instant and to find the amount of time elapsed since that mark.

Link copied to clipboard
fun Clock.todayIn(timeZone: TimeZone): LocalDate

Returns the current date at the given time zone, according to this Clock.