DateTime

value class DateTime(val unixMillis: Double) : Comparable<DateTime> , Serializable

Represents a Date in UTC (GMT+00) with millisecond precision.

It is internally represented as an inlined double, thus doesn't allocate in any target including JS. It can represent without loss dates between (-(2 ** 52) and (2 ** 52)):

  • Thu Aug 10 -140744 07:15:45 GMT-0014 (Central European Summer Time)

  • Wed May 23 144683 18:29:30 GMT+0200 (Central European Summer Time)

Constructors

Link copied to clipboard
constructor(unixMillis: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The day of week part as Int : 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday

Link copied to clipboard

The dayOfYear part

Link copied to clipboard
val hours: Int

The hours part

Link copied to clipboard
Link copied to clipboard

The minutes part

Link copied to clipboard
val month0: Int

The month part as Int where January is represented as 0

Link copied to clipboard
val month1: Int

The month part as Int where January is represented as 1

Link copied to clipboard

Returns the quarter 1, 2, 3 or 4

Link copied to clipboard

The seconds part

Link copied to clipboard

Number of milliseconds since UNIX EPOCH

Link copied to clipboard

Number of milliseconds since UNIX EPOCH as Double

Link copied to clipboard

Number of milliseconds since UNIX EPOCH as Long

Link copied to clipboard

The year part as Int

Link copied to clipboard

Number of milliseconds since the 00:00:00 UTC, Monday, 1 January 1

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open operator override fun compareTo(other: DateTime): Int
Link copied to clipboard
Link copied to clipboard
operator fun minus(other: DateTime): Duration
operator fun minus(delta: FastDuration): DateTime
operator fun minus(delta: Duration): DateTime
Link copied to clipboard
operator fun plus(delta: FastDuration): DateTime
operator fun plus(delta: Duration): DateTime
Link copied to clipboard
Link copied to clipboard
fun DateTime.toNSDate(): NSDate
Link copied to clipboard
open override fun toString(): String