class Date extends Object
Creates a JavaScript Date instance that represents a single moment in time. Date objects are based on a time value that is the number of milliseconds since 1 January, 1970 UTC.
MDN
- Alphabetic
- By Inheritance
- Date
- Object
- Any
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- final def !=(arg0: scala.Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Date, B)
- final def ==(arg0: scala.Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (Date) => Boolean, msg: => scala.Any): Date
- def ensuring(cond: (Date) => Boolean): Date
- def ensuring(cond: Boolean, msg: => scala.Any): Date
- def ensuring(cond: Boolean): Date
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatted(fmtstr: String): String
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDate(): Int
Returns the day of the month (1-31) for the specified date according to local time.
Returns the day of the month (1-31) for the specified date according to local time.
MDN
- def getDay(): Int
Returns the day of the week (0-6) for the specified date according to local time.
Returns the day of the week (0-6) for the specified date according to local time.
MDN
- def getFullYear(): Int
Returns the year (4 digits for 4-digit years) of the specified date according to local time.
Returns the year (4 digits for 4-digit years) of the specified date according to local time.
MDN
- def getHours(): Int
Returns the hour (0-23) in the specified date according to local time.
Returns the hour (0-23) in the specified date according to local time.
MDN
- def getMilliseconds(): Int
Returns the milliseconds (0-999) in the specified date according to local time.
Returns the milliseconds (0-999) in the specified date according to local time.
MDN
- def getMinutes(): Int
Returns the minutes (0-59) in the specified date according to local time.
Returns the minutes (0-59) in the specified date according to local time.
MDN
- def getMonth(): Int
Returns the month (0-11) in the specified date according to local time.
Returns the month (0-11) in the specified date according to local time.
MDN
- def getSeconds(): Int
Returns the seconds (0-59) in the specified date according to local time.
Returns the seconds (0-59) in the specified date according to local time.
MDN
- def getTime(): Double
- def getTimezoneOffset(): Int
Returns the time-zone offset in minutes for the current locale.
Returns the time-zone offset in minutes for the current locale.
MDN
- def getUTCDate(): Int
Returns the day (date) of the month (1-31) in the specified date according to universal time.
Returns the day (date) of the month (1-31) in the specified date according to universal time.
MDN
- def getUTCDay(): Int
Returns the day of the week (0-6) in the specified date according to universal time.
Returns the day of the week (0-6) in the specified date according to universal time. MDN
- def getUTCFullYear(): Int
Returns the year (4 digits for 4-digit years) in the specified date according to universal time.
Returns the year (4 digits for 4-digit years) in the specified date according to universal time.
MDN
- def getUTCHours(): Int
Returns the hours (0-23) in the specified date according to universal time.
Returns the hours (0-23) in the specified date according to universal time.
MDN
- def getUTCMilliseconds(): Int
Returns the milliseconds (0-999) in the specified date according to universal time.
Returns the milliseconds (0-999) in the specified date according to universal time.
MDN
- def getUTCMinutes(): Int
Returns the minutes (0-59) in the specified date according to universal time.
Returns the minutes (0-59) in the specified date according to universal time.
MDN
- def getUTCMonth(): Int
Returns the month (0-11) in the specified date according to universal time.
Returns the month (0-11) in the specified date according to universal time.
MDN
- def getUTCSeconds(): Int
Returns the seconds (0-59) in the specified date according to universal time.
Returns the seconds (0-59) in the specified date according to universal time.
MDN
- def hasOwnProperty(v: String): Boolean
Tests whether this object has the specified property as a direct property.
Tests whether this object has the specified property as a direct property.
Unlike js.Object.hasProperty, this method does not check down the object's prototype chain.
MDN
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
Tests whether this object is in the prototype chain of another object.
Tests whether this object is in the prototype chain of another object.
- Definition Classes
- Object
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def propertyIsEnumerable(v: String): Boolean
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain. If the object does not have the specified property, this method returns false.
MDN
- Definition Classes
- Object
- def setDate(date: Int): Unit
- def setFullYear(year: Int, month: Int = getMonth(), date: Int = getDate()): Unit
- def setHours(hours: Int, min: Int = getMinutes(), sec: Int = getSeconds(), ms: Int = getMilliseconds()): Unit
- def setMilliseconds(ms: Int): Unit
- def setMinutes(min: Int, sec: Int = getSeconds(), ms: Int = getMilliseconds()): Unit
- def setMonth(month: Int, date: Int = getDate()): Unit
- def setSeconds(sec: Int, ms: Int = getMilliseconds()): Unit
- def setTime(time: Double): Unit
- def setUTCDate(date: Int): Unit
- def setUTCFullYear(year: Int, month: Int = getMonth(), date: Int = getDate()): Unit
- def setUTCHours(hours: Int, min: Int = getMinutes(), sec: Int = getSeconds(), ms: Int = getMilliseconds()): Unit
- def setUTCMilliseconds(ms: Int): Unit
- def setUTCMinutes(min: Int, sec: Int = getSeconds(), ms: Int = getMilliseconds()): Unit
- def setUTCMonth(month: Int, date: Int = getDate()): Unit
- def setUTCSeconds(sec: Int, ms: Int = getMilliseconds()): Unit
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toDateString(): String
- def toISOString(): String
- def toJSON(): String
- def toJSON(key: Any): String
- def toLocaleDateString(): String
- def toLocaleString(): String
- Definition Classes
- Object
- def toLocaleTimeString(): String
- def toString(): String
- Definition Classes
- AnyRef → Any
- def toTimeString(): String
- def toUTCString(): String
- def valueOf(): Double
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def →[B](y: B): (Date, B)
- Implicit
- This member is added by an implicit conversion from Date toArrowAssoc[Date] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.