Companion

object Companion

Functions

equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
fromInstant
Link copied to clipboard
common
fun fromInstant(dateTime: DateTime, offset: UtcOffset, zone: TimeZone): ZonedDateTime
Creates a ZonedDateTime from the instant represented by a local date-time and offset.
fromLocal
Link copied to clipboard
common
fun fromLocal(dateTime: DateTime, zone: TimeZone, preferredOffset: UtcOffset? = null): ZonedDateTime
Creates a ZonedDateTime from a local date and time, optionally using a preferred offset.
fromMillisecondOfUnixEpoch
Link copied to clipboard
common
fun fromMillisecondOfUnixEpoch(millisecond: Long, zone: TimeZone): ZonedDateTime
Creates a ZonedDateTime from the millisecond of the Unix epoch at zone.
fromMillisecondsSinceUnixEpoch
Link copied to clipboard
common
fun fromMillisecondsSinceUnixEpoch(milliseconds: LongMilliseconds, zone: TimeZone): ZonedDateTime
Creates a ZonedDateTime from a duration of milliseconds relative to the Unix epoch at zone.
fromSecondOfUnixEpoch
Link copied to clipboard
common
fun fromSecondOfUnixEpoch(second: Long, nanosecond: Int = 0, zone: TimeZone): ZonedDateTime
Creates a ZonedDateTime from the second of the Unix epoch at zone.
fromSecondsSinceUnixEpoch
Link copied to clipboard
common
fun fromSecondsSinceUnixEpoch(seconds: LongSeconds, nanosecondAdjustment: IntNanoseconds = 0.nanoseconds, zone: TimeZone): ZonedDateTime
Creates a ZonedDateTime from a duration of seconds relative to the Unix epoch at zone, optionally, with some number of additional nanoseconds added to it.
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
toString
Link copied to clipboard
common
open fun toString(): String

Properties

DEFAULT_SORT_ORDER
Link copied to clipboard
common
val DEFAULT_SORT_ORDER: Comparator<ZonedDateTime>
A Comparator that compares by instant, then date-time, then time zone.
TIMELINE_ORDER
Link copied to clipboard
common
val TIMELINE_ORDER: Comparator<TimePoint<*>>
A Comparator that compares by timeline order only, ignoring any offset or time zone differences.

Extensions

now
Link copied to clipboard
fun ZonedDateTime.Companion.now(clock: Clock): ZonedDateTime
Gets the current ZonedDateTime from the provided clock.
common
fun ZonedDateTime.Companion.now(): ZonedDateTime
Gets the current ZonedDateTime from the system clock.
common
fun ZonedDateTime.Companion.now(clock: Clock): ZonedDateTime
Gets the current ZonedDateTime from the provided clock.