FixedClock

class FixedClock(instant: Instant, zone: TimeZone) : Clock

A clock with a fixed time, suitable for testing.

Parameters

instant

the initial instant that the clock should be set to

zone

the time zone

Constructors

FixedClock
Link copied to clipboard
common
fun FixedClock(instant: Instant, zone: TimeZone)

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
minusAssign
Link copied to clipboard
common
operator fun minusAssign(days: Days)
operator fun minusAssign(hours: Hours)
operator fun minusAssign(microseconds: Microseconds)
operator fun minusAssign(milliseconds: Milliseconds)
operator fun minusAssign(minutes: Minutes)
operator fun minusAssign(nanoseconds: Nanoseconds)
operator fun minusAssign(seconds: Seconds)
plusAssign
Link copied to clipboard
common
operator fun plusAssign(days: Days)
operator fun plusAssign(hours: Hours)
operator fun plusAssign(microseconds: Microseconds)
operator fun plusAssign(milliseconds: Milliseconds)
operator fun plusAssign(minutes: Minutes)
operator fun plusAssign(nanoseconds: Nanoseconds)
operator fun plusAssign(seconds: Seconds)
readInstant
Link copied to clipboard
common
open override fun readInstant(): Instant

Reads the current Instant.

readMilliseconds
Link copied to clipboard
common
open override 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
open override fun readPlatformInstant(): PlatformInstant

Reads the current PlatformInstant.

setTo
Link copied to clipboard
common
fun setTo(instant: Instant)
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

zone
Link copied to clipboard
common
open override val zone: TimeZone