Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

date constructor javascript

new Date()
new Date(value)
new Date(dateString)
new Date(dateObject)
new Date(year, monthIndex)
new Date(year, monthIndex, day)
new Date(year, monthIndex, day, hours)
new Date(year, monthIndex, day, hours, minutes)
new Date(year, monthIndex, day, hours, minutes, seconds)
new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds)

// Examples
const date1 = new Date('December 17, 2022 03:24:00');
const date2 = new Date('2022-12-17T03:24:00');
const date3 = new Date(2022, 12, 17);
 
PREVIOUS NEXT
Tagged: #date #constructor #javascript
ADD COMMENT
Topic
Name
7+6 =