Class/Object

scala.scalajs.js

Date

Related Docs: object Date | package js

Permalink

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)

    Permalink
  2. new Date(value: String)

    Permalink
  3. new Date(value: Double)

    Permalink
  4. new Date()

    Permalink

Value Members

  1. final def !=(arg0: scala.Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    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)

    Permalink
    Implicit information
    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

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (Date) ⇒ Boolean, msg: ⇒ scala.Any): Date

    Permalink
    Implicit information
    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

    Permalink
    Implicit information
    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

    Permalink
    Implicit information
    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

    Permalink
    Implicit information
    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

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: scala.Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    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[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def getDate(): Double

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  37. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  38. def isPrototypeOf(v: Object): Boolean

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. def propertyIsEnumerable(v: String): Boolean

    Permalink

    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

    Permalink
  44. def setFullYear(year: Double, month: Double = getMonth(), date: Double = getDate()): Unit

    Permalink
  45. def setHours(hours: Double, min: Double = getMinutes(), sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit

    Permalink
  46. def setMilliseconds(ms: Double): Unit

    Permalink
  47. def setMinutes(min: Double, sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit

    Permalink
  48. def setMonth(month: Double, date: Double = getDate()): Unit

    Permalink
  49. def setSeconds(sec: Double, ms: Double = getMilliseconds()): Unit

    Permalink
  50. def setTime(time: Double): Unit

    Permalink
  51. def setUTCDate(date: Double): Unit

    Permalink
  52. def setUTCFullYear(year: Double, month: Double = getMonth(), date: Double = getDate()): Unit

    Permalink
  53. def setUTCHours(hours: Double, min: Double = getMinutes(), sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit

    Permalink
  54. def setUTCMilliseconds(ms: Double): Unit

    Permalink
  55. def setUTCMinutes(min: Double, sec: Double = getSeconds(), ms: Double = getMilliseconds()): Unit

    Permalink
  56. def setUTCMonth(month: Double, date: Double = getDate()): Unit

    Permalink
  57. def setUTCSeconds(sec: Double, ms: Double = getMilliseconds()): Unit

    Permalink
  58. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  59. def toDateString(): String

    Permalink
  60. def toISOString(): String

    Permalink
  61. def toJSON(): String

    Permalink
  62. def toJSON(key: Any): String

    Permalink
  63. def toLocaleDateString(): String

    Permalink
  64. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  65. def toLocaleTimeString(): String

    Permalink
  66. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  67. def toTimeString(): String

    Permalink
  68. def toUTCString(): String

    Permalink
  69. def valueOf(): Double

    Permalink
    Definition Classes
    DateObject
  70. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  71. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  72. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. def [B](y: B): (Date, B)

    Permalink
    Implicit information
    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