Skip to content

//core/io.islandtime/DateTime/Companion

Companion

common

object Companion

Properties

Name Summary
MAX

common


val MAX: DateTime

The latest supported DateTime, which can be used as a "far future" sentinel.
MIN

common


val MIN: DateTime

The earliest supported DateTime, which can be used as a "far past" sentinel.

Functions

Name Summary
fromMillisecondOfUnixEpoch

common


fun fromMillisecondOfUnixEpoch(millisecond: Long, offset: UtcOffset): DateTime

Creates a DateTime from the millisecond of the Unix epoch at offset.
fromMillisecondsSinceUnixEpoch

common


fun fromMillisecondsSinceUnixEpoch(millisecondsSinceUnixEpoch: Milliseconds, offset: UtcOffset): DateTime

Creates a DateTime from a duration of milliseconds relative to the Unix epoch at offset.
fromSecondOfUnixEpoch

common


fun fromSecondOfUnixEpoch(second: Long, nanosecond: Int = 0, offset: UtcOffset): DateTime

Creates a DateTime from the second of the Unix epoch at offset and optionally, the nanosecond of the second.
fromSecondsSinceUnixEpoch

common


fun fromSecondsSinceUnixEpoch(secondsSinceUnixEpoch: Seconds, nanosecondAdjustment: Nanoseconds = 0.nanoseconds, offset: UtcOffset): DateTime

Creates a DateTime from a duration of seconds relative to the Unix epoch at offset, optionally, with some number of additional nanoseconds added to it.
now

common


fun DateTime.Companion.now(): DateTime

Gets the current DateTime from the system clock.

common


fun DateTime.Companion.now(clock: Clock): DateTime

Gets the current DateTime from the provided clock.

jvm


fun DateTime.Companion.now(clock: Clock): DateTime

Gets the current DateTime from the provided clock.