core / io.islandtime.base / TimePoint

TimePoint

(iosArm64, iosX64, jvm, macosX64) interface TimePoint<T>

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.

Properties

(iosArm64, iosX64, jvm, macosX64)

millisecondsSinceUnixEpoch

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

abstract val millisecondsSinceUnixEpoch: LongMilliseconds
(iosArm64, iosX64, jvm, macosX64)

nanoOfSecondsSinceUnixEpoch

The number of additional nanoseconds on top of secondsSinceUnixEpoch

abstract val nanoOfSecondsSinceUnixEpoch: IntNanoseconds
(iosArm64, iosX64, jvm, macosX64)

secondsSinceUnixEpoch

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

abstract val secondsSinceUnixEpoch: LongSeconds
(iosArm64, iosX64, jvm, macosX64)

unixEpochMillisecond

The millisecond of the Unix epoch

open val unixEpochMillisecond: Long
(iosArm64, iosX64, jvm, macosX64)

unixEpochNanoOfSecond

The nanosecond of the second of the Unix epoch

open val unixEpochNanoOfSecond: Int
(iosArm64, iosX64, jvm, macosX64)

unixEpochSecond

The second of the Unix epoch

open val unixEpochSecond: Long

Functions

(iosArm64, iosX64, jvm, macosX64)

compareTo

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
(iosArm64, iosX64, jvm, macosX64)

isSameInstantAs

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

open fun isSameInstantAs(other: TimePoint<*>): Boolean
(iosArm64, iosX64, jvm, macosX64)

minus

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
(iosArm64, iosX64, jvm, macosX64)

plus

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

Companion Object Properties

TIMELINE_ORDER

Compare by timeline order.

(iosArm64, iosX64, macosX64) val TIMELINE_ORDER: <ERROR CLASS>
(jvm) val TIMELINE_ORDER: Comparator<TimePoint<*>>

Inheritors

(iosArm64, iosX64, jvm, macosX64)

Instant

An instant in time with nanosecond precision.

class Instant : TimePoint<Instant>, Comparable<Instant>
(iosArm64, iosX64, jvm, macosX64)

OffsetDateTime

A date and time of day with an offset from UTC.

class OffsetDateTime : TimePoint<OffsetDateTime>
(iosArm64, iosX64, jvm, macosX64)

ZonedDateTime

A date and time of day in a particular region.

class ZonedDateTime : TimePoint<ZonedDateTime>