TimePoint

An object that can be placed exactly in time.

An implementor of this interface contains enough information to represent an instant in time. As such, any time point can be compared to another on the timeline and duration units can be added or subtracted.

interface TimePoint<T>

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common

Compares this time point with another time point.

Time points can be compared to other time points based on timeline order, but aren't required to implement the Comparable interface since they don't necessarily have a natural order that's consistent with equals.

open operator fun compareTo(other: TimePoint<*>): Int
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
isSameInstantAs
Link copied to clipboard
common

Checks if this time point represents the same instant as other. Unlike the equals operator, equality is determined solely by timeline order.

open fun isSameInstantAs(other: TimePoint<*>): Boolean
minus
Link copied to clipboard
common
abstract operator fun minus(hours: IntHours): T
abstract operator fun minus(hours: LongHours): T
abstract operator fun minus(minutes: IntMinutes): T
abstract operator fun minus(minutes: LongMinutes): T
abstract operator fun minus(seconds: IntSeconds): T
abstract operator fun minus(seconds: LongSeconds): T
abstract operator fun minus(milliseconds: IntMilliseconds): T
abstract operator fun minus(milliseconds: LongMilliseconds): T
abstract operator fun minus(microseconds: IntMicroseconds): T
abstract operator fun minus(microseconds: LongMicroseconds): T
abstract operator fun minus(nanoseconds: IntNanoseconds): T
abstract operator fun minus(nanoseconds: LongNanoseconds): T
plus
Link copied to clipboard
common
abstract operator fun plus(hours: IntHours): T
abstract operator fun plus(hours: LongHours): T
abstract operator fun plus(minutes: IntMinutes): T
abstract operator fun plus(minutes: LongMinutes): T
abstract operator fun plus(seconds: IntSeconds): T
abstract operator fun plus(seconds: LongSeconds): T
abstract operator fun plus(milliseconds: IntMilliseconds): T
abstract operator fun plus(milliseconds: LongMilliseconds): T
abstract operator fun plus(microseconds: IntMicroseconds): T
abstract operator fun plus(microseconds: LongMicroseconds): T
abstract operator fun plus(nanoseconds: IntNanoseconds): T
abstract operator fun plus(nanoseconds: LongNanoseconds): T
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

additionalNanosecondsSinceUnixEpoch
Link copied to clipboard
common

The number of additional nanoseconds on top of secondsSinceUnixEpoch.

abstract val additionalNanosecondsSinceUnixEpoch: IntNanoseconds
millisecondOfUnixEpoch
Link copied to clipboard
common

The millisecond of the Unix epoch.

open val millisecondOfUnixEpoch: Long
millisecondsSinceUnixEpoch
Link copied to clipboard
common

The number of milliseconds since the Unix epoch of 1970-01-01T00:00Z.

abstract val millisecondsSinceUnixEpoch: LongMilliseconds
nanosecond
Link copied to clipboard
common

The nanosecond of the second.

open val nanosecond: Int
secondOfUnixEpoch
Link copied to clipboard
common

The second of the Unix epoch.

open val secondOfUnixEpoch: Long
secondsSinceUnixEpoch
Link copied to clipboard
common

The number of seconds since the Unix epoch of 1970-01-01T00:00Z.

abstract val secondsSinceUnixEpoch: LongSeconds

Inheritors

Instant
Link copied to clipboard
common
OffsetDateTime
Link copied to clipboard
common
ZonedDateTime
Link copied to clipboard
common

Extensions

toNSDate
Link copied to clipboard
darwin

Converts this time point to an NSDate.

fun <T> TimePoint<T>.toNSDate(): <ERROR CLASS>