0Pricing
JavaScript Academy · Lesson

Creating and Reading Dates

Construct Date objects and read components.

The Date Object

The Date object represents a single moment in time. You create one with the Date constructor using new.

const now = new Date()
console.log(now instanceof Date)

Current Date

Calling new Date with no arguments captures the current moment according to the system clock.

const now = new Date()
console.log(typeof now.getTime())

All lessons in this course

  1. Creating and Reading Dates
  2. Timestamps and Date Math
  3. Formatting Dates
  4. Time Zones and UTC
← Back to JavaScript Academy