Date

@JSGlobal("Date") @native @JSType class Date() extends StObject with Date
Companion
object
trait Date
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Constructors

def this(value: String)
def this(value: Date)
def this(value: Double)
def this(year: Double, month: Double)
def this(year: Double, month: Double, date: Double)
def this(year: Double, month: Double, date: Double, hours: Double)
def this(year: Double, month: Double, date: Unit, hours: Double)
def this(year: Double, month: Double, date: Double, hours: Double, minutes: Double)
def this(year: Double, month: Double, date: Double, hours: Unit, minutes: Double)
def this(year: Double, month: Double, date: Unit, hours: Double, minutes: Double)
def this(year: Double, month: Double, date: Unit, hours: Unit, minutes: Double)
def this(year: Double, month: Double, date: Double, hours: Double, minutes: Double, seconds: Double)
def this(year: Double, month: Double, date: Double, hours: Double, minutes: Unit, seconds: Double)
def this(year: Double, month: Double, date: Double, hours: Unit, minutes: Double, seconds: Double)
def this(year: Double, month: Double, date: Double, hours: Unit, minutes: Unit, seconds: Double)
def this(year: Double, month: Double, date: Unit, hours: Double, minutes: Double, seconds: Double)
def this(year: Double, month: Double, date: Unit, hours: Double, minutes: Unit, seconds: Double)
def this(year: Double, month: Double, date: Unit, hours: Unit, minutes: Double, seconds: Double)
def this(year: Double, month: Double, date: Unit, hours: Unit, minutes: Unit, seconds: Double)
def this(year: Double, month: Double, date: Double, hours: Double, minutes: Double, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Double, hours: Double, minutes: Double, seconds: Unit, ms: Double)
def this(year: Double, month: Double, date: Double, hours: Double, minutes: Unit, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Double, hours: Double, minutes: Unit, seconds: Unit, ms: Double)
def this(year: Double, month: Double, date: Double, hours: Unit, minutes: Double, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Double, hours: Unit, minutes: Double, seconds: Unit, ms: Double)
def this(year: Double, month: Double, date: Double, hours: Unit, minutes: Unit, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Double, hours: Unit, minutes: Unit, seconds: Unit, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Double, minutes: Double, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Double, minutes: Double, seconds: Unit, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Double, minutes: Unit, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Double, minutes: Unit, seconds: Unit, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Unit, minutes: Double, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Unit, minutes: Double, seconds: Unit, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Unit, minutes: Unit, seconds: Double, ms: Double)
def this(year: Double, month: Double, date: Unit, hours: Unit, minutes: Unit, seconds: Unit, ms: Double)

Inherited methods

def getDate(): Double

Gets the day-of-the-month, using local time.

Gets the day-of-the-month, using local time.

Inherited from
Date
def getDay(): Double

Gets the day of the week, using local time.

Gets the day of the week, using local time.

Inherited from
Date
def getFullYear(): Double

Gets the year, using local time.

Gets the year, using local time.

Inherited from
Date
def getHours(): Double

Gets the hours in a date, using local time.

Gets the hours in a date, using local time.

Inherited from
Date
def getMilliseconds(): Double

Gets the milliseconds of a Date, using local time.

Gets the milliseconds of a Date, using local time.

Inherited from
Date
def getMinutes(): Double

Gets the minutes of a Date object, using local time.

Gets the minutes of a Date object, using local time.

Inherited from
Date
def getMonth(): Double

Gets the month, using local time.

Gets the month, using local time.

Inherited from
Date
def getSeconds(): Double

Gets the seconds of a Date object, using local time.

Gets the seconds of a Date object, using local time.

Inherited from
Date
def getTime(): Double

Gets the time value in milliseconds.

Gets the time value in milliseconds.

Inherited from
Date
def getTimezoneOffset(): Double

Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).

Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCDate(): Double

Gets the day-of-the-month, using Universal Coordinated Time (UTC).

Gets the day-of-the-month, using Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCDay(): Double

Gets the day of the week using Universal Coordinated Time (UTC).

Gets the day of the week using Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCFullYear(): Double

Gets the year using Universal Coordinated Time (UTC).

Gets the year using Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCHours(): Double

Gets the hours value in a Date object using Universal Coordinated Time (UTC).

Gets the hours value in a Date object using Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCMilliseconds(): Double

Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).

Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCMinutes(): Double

Gets the minutes of a Date object using Universal Coordinated Time (UTC).

Gets the minutes of a Date object using Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCMonth(): Double

Gets the month of a Date object using Universal Coordinated Time (UTC).

Gets the month of a Date object using Universal Coordinated Time (UTC).

Inherited from
Date
def getUTCSeconds(): Double

Gets the seconds of a Date object using Universal Coordinated Time (UTC).

Gets the seconds of a Date object using Universal Coordinated Time (UTC).

Inherited from
Date
def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def setDate(date: Double): Double

Sets the numeric day-of-the-month value of the Date object using local time.

Sets the numeric day-of-the-month value of the Date object using local time.

Value Params
date

A numeric value equal to the day of the month.

Inherited from
Date
def setFullYear(year: Double, month: Unit, date: Double): Double
Inherited from
Date
def setFullYear(year: Double, month: Double, date: Double): Double
Inherited from
Date
def setFullYear(year: Double, month: Double): Double
Inherited from
Date
def setFullYear(year: Double): Double

Sets the year of the Date object using local time.

Sets the year of the Date object using local time.

Value Params
date

A numeric value equal for the day of the month.

month

A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.

year

A numeric value for the year.

Inherited from
Date
def setHours(hours: Double, min: Unit, sec: Unit, ms: Double): Double
Inherited from
Date
def setHours(hours: Double, min: Unit, sec: Double, ms: Double): Double
Inherited from
Date
def setHours(hours: Double, min: Unit, sec: Double): Double
Inherited from
Date
def setHours(hours: Double, min: Double, sec: Unit, ms: Double): Double
Inherited from
Date
def setHours(hours: Double, min: Double, sec: Double, ms: Double): Double
Inherited from
Date
def setHours(hours: Double, min: Double, sec: Double): Double
Inherited from
Date
def setHours(hours: Double, min: Double): Double
Inherited from
Date
def setHours(hours: Double): Double

Sets the hour value in the Date object using local time.

Sets the hour value in the Date object using local time.

Value Params
hours

A numeric value equal to the hours value.

min

A numeric value equal to the minutes value.

ms

A numeric value equal to the milliseconds value.

sec

A numeric value equal to the seconds value.

Inherited from
Date
def setMilliseconds(ms: Double): Double

Sets the milliseconds value in the Date object using local time.

Sets the milliseconds value in the Date object using local time.

Value Params
ms

A numeric value equal to the millisecond value.

Inherited from
Date
def setMinutes(min: Double, sec: Unit, ms: Double): Double
Inherited from
Date
def setMinutes(min: Double, sec: Double, ms: Double): Double
Inherited from
Date
def setMinutes(min: Double, sec: Double): Double
Inherited from
Date
def setMinutes(min: Double): Double

Sets the minutes value in the Date object using local time.

Sets the minutes value in the Date object using local time.

Value Params
min

A numeric value equal to the minutes value.

ms

A numeric value equal to the milliseconds value.

sec

A numeric value equal to the seconds value.

Inherited from
Date
def setMonth(month: Double, date: Double): Double
Inherited from
Date
def setMonth(month: Double): Double

Sets the month value in the Date object using local time.

Sets the month value in the Date object using local time.

Value Params
date

A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.

month

A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.

Inherited from
Date
def setSeconds(sec: Double, ms: Double): Double
Inherited from
Date
def setSeconds(sec: Double): Double

Sets the seconds value in the Date object using local time.

Sets the seconds value in the Date object using local time.

Value Params
ms

A numeric value equal to the milliseconds value.

sec

A numeric value equal to the seconds value.

Inherited from
Date
def setTime(time: Double): Double

Sets the date and time value in the Date object.

Sets the date and time value in the Date object.

Value Params
time

A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.

Inherited from
Date
def setUTCDate(date: Double): Double

Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).

Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).

Value Params
date

A numeric value equal to the day of the month.

Inherited from
Date
def setUTCFullYear(year: Double, month: Unit, date: Double): Double
Inherited from
Date
def setUTCFullYear(year: Double, month: Double, date: Double): Double
Inherited from
Date
def setUTCFullYear(year: Double, month: Double): Double
Inherited from
Date
def setUTCFullYear(year: Double): Double

Sets the year value in the Date object using Universal Coordinated Time (UTC).

Sets the year value in the Date object using Universal Coordinated Time (UTC).

Value Params
date

A numeric value equal to the day of the month.

month

A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.

year

A numeric value equal to the year.

Inherited from
Date
def setUTCHours(hours: Double, min: Unit, sec: Unit, ms: Double): Double
Inherited from
Date
def setUTCHours(hours: Double, min: Unit, sec: Double, ms: Double): Double
Inherited from
Date
def setUTCHours(hours: Double, min: Unit, sec: Double): Double
Inherited from
Date
def setUTCHours(hours: Double, min: Double, sec: Unit, ms: Double): Double
Inherited from
Date
def setUTCHours(hours: Double, min: Double, sec: Double, ms: Double): Double
Inherited from
Date
def setUTCHours(hours: Double, min: Double, sec: Double): Double
Inherited from
Date
def setUTCHours(hours: Double, min: Double): Double
Inherited from
Date
def setUTCHours(hours: Double): Double

Sets the hours value in the Date object using Universal Coordinated Time (UTC).

Sets the hours value in the Date object using Universal Coordinated Time (UTC).

Value Params
hours

A numeric value equal to the hours value.

min

A numeric value equal to the minutes value.

ms

A numeric value equal to the milliseconds value.

sec

A numeric value equal to the seconds value.

Inherited from
Date
def setUTCMilliseconds(ms: Double): Double

Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).

Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).

Value Params
ms

A numeric value equal to the millisecond value.

Inherited from
Date
def setUTCMinutes(min: Double, sec: Unit, ms: Double): Double
Inherited from
Date
def setUTCMinutes(min: Double, sec: Double, ms: Double): Double
Inherited from
Date
def setUTCMinutes(min: Double, sec: Double): Double
Inherited from
Date
def setUTCMinutes(min: Double): Double

Sets the minutes value in the Date object using Universal Coordinated Time (UTC).

Sets the minutes value in the Date object using Universal Coordinated Time (UTC).

Value Params
min

A numeric value equal to the minutes value.

ms

A numeric value equal to the milliseconds value.

sec

A numeric value equal to the seconds value.

Inherited from
Date
def setUTCMonth(month: Double, date: Double): Double
Inherited from
Date
def setUTCMonth(month: Double): Double

Sets the month value in the Date object using Universal Coordinated Time (UTC).

Sets the month value in the Date object using Universal Coordinated Time (UTC).

Value Params
date

A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.

month

A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.

Inherited from
Date
def setUTCSeconds(sec: Double, ms: Double): Double
Inherited from
Date
def setUTCSeconds(sec: Double): Double

Sets the seconds value in the Date object using Universal Coordinated Time (UTC).

Sets the seconds value in the Date object using Universal Coordinated Time (UTC).

Value Params
ms

A numeric value equal to the milliseconds value.

sec

A numeric value equal to the seconds value.

Inherited from
Date
def toDateString(): String

Returns a date as a string value.

Returns a date as a string value.

Inherited from
Date
def toISOString(): String

Returns a date as a string value in ISO format.

Returns a date as a string value in ISO format.

Inherited from
Date
def toJSON(key: Any): String
Inherited from
Date
def toJSON(): String

Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

Inherited from
Date
def toLocaleDateString(locales: Unit, options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleDateString(locales: Array[String], options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleDateString(locales: Array[String]): String
Inherited from
Date
def toLocaleDateString(locales: String, options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleDateString(locales: String): String
Inherited from
Date
def toLocaleDateString(): String

Returns a date as a string value appropriate to the host environment's current locale.

Returns a date as a string value appropriate to the host environment's current locale.

Inherited from
Date
def toLocaleString(locales: Unit, options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleString(locales: Array[String], options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleString(locales: Array[String]): String
Inherited from
Date
def toLocaleString(locales: String, options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleString(locales: String): String
Inherited from
Date
def toLocaleString(): String
Inherited from
Object
def toLocaleTimeString(locales: Unit, options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleTimeString(locales: Array[String], options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleTimeString(locales: Array[String]): String
Inherited from
Date
def toLocaleTimeString(locales: String, options: DateTimeFormatOptions): String
Inherited from
Date
def toLocaleTimeString(locales: String): String
Inherited from
Date
def toLocaleTimeString(): String

Returns a time as a string value appropriate to the host environment's current locale.

Returns a time as a string value appropriate to the host environment's current locale.

Inherited from
Date
def toTimeString(): String

Returns a time as a string value.

Returns a time as a string value.

Inherited from
Date
def toUTCString(): String

Returns a date converted to a string using Universal Coordinated Time (UTC).

Returns a date converted to a string using Universal Coordinated Time (UTC).

Inherited from
Date
def valueOf(): Any
Inherited from
Object

Inherited fields

@JSName
var toPrimitive: Function1[default, String] & Function1[string, String] & Function1[number, Double] & Function1[String, String | Double]

Converts a Date object to a string or number.

Converts a Date object to a string or number.

Value Params
hint

The strings "number", "string", or "default" to specify what primitive to return.

Throws
{TypeError}

If 'hint' was given something other than "number", "string", or "default".

Inherited from
Date