Companion

object Companion

Functions

equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
fromMillisecondOfUnixEpoch
Link copied to clipboard
common

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

fun fromMillisecondOfUnixEpoch(millisecond: Long, offset: UtcOffset): DateTime
fromMillisecondsSinceUnixEpoch
Link copied to clipboard
common

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

fun fromMillisecondsSinceUnixEpoch(millisecondsSinceUnixEpoch: LongMilliseconds, offset: UtcOffset): DateTime
fromSecondOfUnixEpoch
Link copied to clipboard
common

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

fun fromSecondOfUnixEpoch(second: Long, nanosecond: Int, offset: UtcOffset): DateTime
fromSecondsSinceUnixEpoch
Link copied to clipboard
common

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.

fun fromSecondsSinceUnixEpoch(secondsSinceUnixEpoch: LongSeconds, nanosecondAdjustment: IntNanoseconds, offset: UtcOffset): DateTime
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

MAX
Link copied to clipboard
common

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

val MAX: DateTime
MIN
Link copied to clipboard
common

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

val MIN: DateTime

Extensions

now
Link copied to clipboard

Gets the current DateTime from the provided clock.

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

Gets the current DateTime from the system clock.

common
fun DateTime.Companion.now(): DateTime

Gets the current DateTime from the provided clock.

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