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 an OffsetDateTime from the millisecond of the Unix epoch at offset.

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

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

fun fromMillisecondsSinceUnixEpoch(milliseconds: LongMilliseconds, offset: UtcOffset): OffsetDateTime
fromSecondOfUnixEpoch
Link copied to clipboard
common

Creates an OffsetDateTime from the second of the Unix epoch at offset and optionally, the nanosecond of the second.

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

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

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

Properties

DEFAULT_SORT_ORDER
Link copied to clipboard
common

A Comparator that compares by instant, then date-time. Using this Comparator guarantees a deterministic order when sorting.

val DEFAULT_SORT_ORDER: Comparator<OffsetDateTime>
MAX
Link copied to clipboard
common

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

val MAX: OffsetDateTime
MIN
Link copied to clipboard
common

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

val MIN: OffsetDateTime
TIMELINE_ORDER
Link copied to clipboard
common

A Comparator that compares by timeline order only, ignoring any offset differences.

val TIMELINE_ORDER: Comparator<TimePoint<*>>

Extensions

now
Link copied to clipboard

Gets the current OffsetDateTime from the provided clock.

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

Gets the current OffsetDateTime from the system clock.

common
fun OffsetDateTime.Companion.now(): OffsetDateTime

Gets the current OffsetDateTime from the provided clock.

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