Packages

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

Annotations
@JSType() @native() @JSGlobal()
Note

js.Date objects can represent an *invalid date*, for example, if they are constructed from a String that cannot be parsed as a date. Most methods of such a js.Date will return NaN (for those returning a Double) or other invalid values.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Date
  2. Object
  3. Any
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Date(year: Int, month: Int, date: Int = 1, hours: Int = 0, minutes: Int = 0, seconds: Int = 0, ms: Int = 0)
  2. new Date(value: String)
  3. new Date(value: Double)
  4. new Date()

Value Members

  1. final def !=(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Date to any2stringadd[Date] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Date, B)
    Implicit
    This member is added by an implicit conversion from Date to ArrowAssoc[Date] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def ensuring(cond: (Date) ⇒ Boolean, msg: ⇒ scala.Any): Date
    Implicit
    This member is added by an implicit conversion from Date to Ensuring[Date] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (Date) ⇒ Boolean): Date
    Implicit
    This member is added by an implicit conversion from Date to Ensuring[Date] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ scala.Any): Date
    Implicit
    This member is added by an implicit conversion from Date to Ensuring[Date] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): Date
    Implicit
    This member is added by an implicit conversion from Date to Ensuring[Date] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Date to StringFormat[Date] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def getDate(): Double

    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

  18. def getDay(): Double

    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

  19. def getFullYear(): Double

    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

  20. def getHours(): Double

    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

  21. def getMilliseconds(): Double

    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

  22. def getMinutes(): Double

    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

  23. def getMonth(): Double

    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

  24. def getSeconds(): Double

    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

  25. def getTime(): Double

    Returns the numeric value of the specified date as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

    Returns the numeric value of the specified date as the number of milliseconds since January 1, 1970, 00:00:00 UTC. (Negative values are returned for prior times).

    MDN

  26. def getTimezoneOffset(): Double

    Returns the time-zone offset in minutes for the current locale.

    Returns the time-zone offset in minutes for the current locale.

    MDN

  27. def getUTCDate(): Double

    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

  28. def getUTCDay(): Double

    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

  29. def getUTCFullYear(): Double

    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

  30. def getUTCHours(): Double

    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

  31. def getUTCMilliseconds(): Double

    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

  32. def getUTCMinutes(): Double

    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

  33. def getUTCMonth(): Double

    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

  34. def getUTCSeconds(): Double

    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

  35. 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
  36. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  37. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  38. 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
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  42. 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
  43. def setDate(date: Double): Unit
  44. def setFullYear(year: Double, month: Double = getMonth(), date: Double = getDate()): Unit
  45. def setHours(hours: Double, min: Double = getMinutes(), sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit
  46. def setMilliseconds(ms: Double): Unit
  47. def setMinutes(min: Double, sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit
  48. def setMonth(month: Double, date: Double = getDate()): Unit
  49. def setSeconds(sec: Double, ms: Double = getMilliseconds()): Unit
  50. def setTime(time: Double): Unit
  51. def setUTCDate(date: Double): Unit
  52. def setUTCFullYear(year: Double, month: Double = getMonth(), date: Double = getDate()): Unit
  53. def setUTCHours(hours: Double, min: Double = getMinutes(), sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit
  54. def setUTCMilliseconds(ms: Double): Unit
  55. def setUTCMinutes(min: Double, sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit
  56. def setUTCMonth(month: Double, date: Double = getDate()): Unit
  57. def setUTCSeconds(sec: Double, ms: Double = getMilliseconds()): Unit
  58. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  59. def toDateString(): String
  60. def toISOString(): String
  61. def toJSON(): String
  62. def toJSON(key: Any): String
  63. def toLocaleDateString(): String
  64. def toLocaleString(): String
    Definition Classes
    Object
  65. def toLocaleTimeString(): String
  66. def toString(): String
    Definition Classes
    AnyRef → Any
  67. def toTimeString(): String
  68. def toUTCString(): String
  69. def valueOf(): Double
    Definition Classes
    DateObject
  70. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  71. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  72. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  73. def [B](y: B): (Date, B)
    Implicit
    This member is added by an implicit conversion from Date to ArrowAssoc[Date] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from scala.Any

Inherited by implicit conversion any2stringadd from Date to any2stringadd[Date]

Inherited by implicit conversion StringFormat from Date to StringFormat[Date]

Inherited by implicit conversion Ensuring from Date to Ensuring[Date]

Inherited by implicit conversion ArrowAssoc from Date to ArrowAssoc[Date]

Ungrouped