Learn JavaScript
Date
29.4
Lesson

Date setter methods

The Date object has a number of setter methods to set the value of its properties.

The setTime() method sets the number of milliseconds between January 1, 1970 and the date.

The setFullYear() method sets the year as a four-digit number.

The setMonth() method sets the month as a number between 0 and 11. 0 stands for January and 11 stands for December.

The setDate() method sets the day as a number between 1 and 31.

The setHours() method sets the hour as a number between 0 and 23.

The setMinutes() method sets the minutes as a number between 0 and 59.

The setSeconds() method sets the seconds as a number between 0 and 59.

The setMilliseconds() method sets the milliseconds as a number between 0 and 999.