W3cubDocs

/Kotlin

Date

external class Date

Platform and version requirements: JS

Exposes the Date API to Kotlin.

Types

LocaleOptions

interface LocaleOptions

Constructors

<init>

Date(milliseconds: Number)
Date(dateString: String)
Date(year: Int, month: Int)
Date(year: Int, month: Int, day: Int)
Date(year: Int, month: Int, day: Int, hour: Int)
Date(year: Int, month: Int, day: Int, hour: Int, minute: Int)
Date(
    year: Int, 
    month: Int, 
    day: Int, 
    hour: Int, 
    minute: Int, 
    second: Int)
Date(
    year: Int, 
    month: Int, 
    day: Int, 
    hour: Int, 
    minute: Int, 
    second: Int, 
    millisecond: Number)
Date()

Exposes the Date API to Kotlin.

Functions

getDate

fun getDate(): Int

getDay

fun getDay(): Int

getFullYear

fun getFullYear(): Int

getHours

fun getHours(): Int

getMilliseconds

fun getMilliseconds(): Int

getMinutes

fun getMinutes(): Int

getMonth

fun getMonth(): Int

getSeconds

fun getSeconds(): Int

getTime

fun getTime(): Double

getTimezoneOffset

fun getTimezoneOffset(): Int

getUTCDate

fun getUTCDate(): Int

getUTCDay

fun getUTCDay(): Int

getUTCFullYear

fun getUTCFullYear(): Int

getUTCHours

fun getUTCHours(): Int

getUTCMilliseconds

fun getUTCMilliseconds(): Int

getUTCMinutes

fun getUTCMinutes(): Int

getUTCMonth

fun getUTCMonth(): Int

getUTCSeconds

fun getUTCSeconds(): Int

toDateString

fun toDateString(): String

toISOString

fun toISOString(): String

toJSON

fun toJSON(): Json

toLocaleDateString

fun toLocaleDateString(
    locales: Array<String> = definedExternally, 
    options: LocaleOptions = definedExternally
): String
fun toLocaleDateString(
    locales: String, 
    options: LocaleOptions = definedExternally
): String

toLocaleString

fun toLocaleString(
    locales: Array<String> = definedExternally, 
    options: LocaleOptions = definedExternally
): String
fun toLocaleString(
    locales: String, 
    options: LocaleOptions = definedExternally
): String

toLocaleTimeString

fun toLocaleTimeString(
    locales: Array<String> = definedExternally, 
    options: LocaleOptions = definedExternally
): String
fun toLocaleTimeString(
    locales: String, 
    options: LocaleOptions = definedExternally
): String

toTimeString

fun toTimeString(): String

toUTCString

fun toUTCString(): String

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Companion Object Functions

UTC

fun UTC(year: Int, month: Int): Double
fun UTC(year: Int, month: Int, day: Int): Double
fun UTC(year: Int, month: Int, day: Int, hour: Int): Double
fun UTC(
    year: Int, 
    month: Int, 
    day: Int, 
    hour: Int, 
    minute: Int
): Double
fun UTC(
    year: Int, 
    month: Int, 
    day: Int, 
    hour: Int, 
    minute: Int, 
    second: Int
): Double
fun UTC(
    year: Int, 
    month: Int, 
    day: Int, 
    hour: Int, 
    minute: Int, 
    second: Int, 
    millisecond: Number
): Double

now

fun now(): Double

parse

fun parse(dateString: String): Double

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/-date/index.html