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
fun dateToMillis(year: Int, month: Int, day: Int): Double
Link copied to clipboard
fun dateToMillisUnchecked(year: Int, month: Int, day: Int): Double
Link copied to clipboard
fun DateTime.Companion.fromCFAbsoluteTime(cfAbsoluteTime: Double): DateTime
Link copied to clipboard
fun fromUnixMillis(unix: Double): DateTime
fun fromUnixMillis(unix: Long): DateTime

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(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
fun nowUnixMillis(): Double

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
fun nowUnixMillisLong(): Long

Returns the total milliseconds since unix epoch.

Link copied to clipboard
fun timeToMillis(hour: Int, minute: Int, second: Int): Double
Link copied to clipboard
fun timeToMillisUnchecked(hour: Int, minute: Int, second: Int): Double