JS: Date Object

By Xah Lee. Date: . Last updated: .

Date is the value of the property key "Date" of the global object. [JS: the Global Object]

console.log ( window.Date === Date ); // true

Type

Date is a function.

[see JS: Value Types]

console.log ( typeof Date === "function" ); // true

Parent

Parent of Date is Function.prototype.

console.log ( Reflect.getPrototypeOf ( Date ) === Function.prototype ); // true

Purpose

Purpose of Date is:

  1. To create a date instance. (by new Date(…))
  2. Used as a namespace to hold static methods for working with date. For example, Date.parse(string).
  3. Holds the property key "prototype". The value of Date.prototype is the root parent object of all date instances. [see JS: Prototype and Inheritance]

Date Constructor

JS: Date Constructor

Properties

JS Date

  1. JS: Date Tutorial
  2. JS: Date.parse
  3. JS: Compute Date Range
  4. JS: Date Object
  5. JS: Date Constructor
  6. JS: Date.prototype

JS Object Reference

  1. Global
  2. Object
  3. Array
  4. Function
  5. String
  6. RegExp
  7. Date
  8. Set
  9. Map
  10. JSON
  11. Math
  12. Reflect
  13. Number
  14. Boolean
  15. Symbol
Liket it? I spend 2 years writing this tutorial. Help me spread it. Tell your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Object Reference
  5. DOM Scripting
  6. SVG
  7. Blog