Date

external class Date(source)

Exposes the Date API to Kotlin.

Since Kotlin

1.1

Constructors

Link copied to clipboard
constructor()
constructor(milliseconds: Number)
constructor(dateString: String)
constructor(year: Int, month: Int)
constructor(year: Int, month: Int, day: Int)
constructor(year: Int, month: Int, day: Int, hour: Int)
constructor(year: Int, month: Int, day: Int, hour: Int, minute: Int)
constructor(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int)
constructor(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int, millisecond: Number)

Types

Link copied to clipboard
external object Companion
Since Kotlin 1.1
Link copied to clipboard
external interface LocaleOptions
Since Kotlin 1.1

Functions

Link copied to clipboard
external fun getDate(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getDay(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getFullYear(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getHours(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getMilliseconds(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getMinutes(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getMonth(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getSeconds(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getTime(): Double
Since Kotlin 1.1
Link copied to clipboard
external fun getTimezoneOffset(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCDate(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCDay(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCFullYear(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCHours(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCMilliseconds(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCMinutes(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCMonth(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun getUTCSeconds(): Int
Since Kotlin 1.1
Link copied to clipboard
external fun toDateString(): String
Since Kotlin 1.1
Link copied to clipboard
external fun toISOString(): String
Since Kotlin 1.1
Link copied to clipboard
external fun toJSON(): Json
Since Kotlin 1.1
Link copied to clipboard

Converts the JS Date to the corresponding Instant.

Since Kotlin 2.3
Link copied to clipboard
external fun toLocaleDateString(locales: Array<String> = definedExternally, options: Date.LocaleOptions = definedExternally): String
external fun toLocaleDateString(locales: String, options: Date.LocaleOptions = definedExternally): String
Since Kotlin 1.1
Link copied to clipboard
external fun toLocaleString(locales: Array<String> = definedExternally, options: Date.LocaleOptions = definedExternally): String
external fun toLocaleString(locales: String, options: Date.LocaleOptions = definedExternally): String
Since Kotlin 1.1
Link copied to clipboard
external fun toLocaleTimeString(locales: Array<String> = definedExternally, options: Date.LocaleOptions = definedExternally): String
external fun toLocaleTimeString(locales: String, options: Date.LocaleOptions = definedExternally): String
Since Kotlin 1.1
Link copied to clipboard
external fun toTimeString(): String
Since Kotlin 1.1
Link copied to clipboard
external fun toUTCString(): String
Since Kotlin 1.1