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
- Creating and Reading Dates
- Timestamps and Date Math
- Formatting Dates
- Time Zones and UTC