Companion

object Companion

Properties

Link copied to clipboard

It is a DateTime instance representing 00:00:00 UTC, Thursday, 1 January 1970.

Functions

Link copied to clipboard
fun createAdjusted(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0, milliseconds: Int = 0): DateTime

Constructs a new DateTime from date and time information.

Link copied to clipboard
fun createClamped(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0, milliseconds: Int = 0): DateTime

Constructs a new DateTime from date and time information.

Link copied to clipboard
fun createUnchecked(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0, milliseconds: Int = 0): DateTime

Constructs a new DateTime from date and time information.

Link copied to clipboard
Link copied to clipboard

Constructs a new DateTime by parsing the str using standard date formats.

Link copied to clipboard

Constructs a new DateTime from a unix timestamp in milliseconds.

Link copied to clipboard
operator fun invoke(unix: Double): DateTime
operator fun invoke(unix: Long): DateTime

Constructs a new DateTime from a unix timestamp in milliseconds.

operator fun invoke(date: Date, time: Time = Time(0.milliseconds)): DateTime
operator fun invoke(year: Year, month: Month, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0, milliseconds: Int = 0): DateTime
operator fun invoke(year: Int, month: Month, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0, milliseconds: Int = 0): DateTime
operator fun invoke(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0, milliseconds: Int = 0): DateTime

Constructs a new DateTime from date and time information.

Link copied to clipboard
fun now(): DateTime

Returns the current time as DateTime. Note that since DateTime is inline, this property doesn't allocate on JavaScript.

Link copied to clipboard

Returns the current local time as DateTimeTz.

Link copied to clipboard

Returns the total milliseconds since unix epoch. The same as nowUnixMillisLong but as double. To prevent allocation on targets without Long support.

Link copied to clipboard

Returns the total milliseconds since unix epoch.

Link copied to clipboard

Constructs a new DateTime by parsing the str using standard date formats.