Date.setFullYear()
Sets the year of a date object
The setFullYear() method sets the full year for a specified date according to local time. Returns new timestamp.
Syntax
Parameters
yearValue
An integer specifying the numeric value of the year, for example, 1995.
monthValue
Optional. An integer between 0 and 11 representing the months January through December.
dateValue
Optional. An integer between 1 and 31 representing the day of the month. If you specify the dateValue
parameter, you must also specify the monthValue
.
Return value
The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date.
Description
Examples
Using setFullYear()
setFullYear()
References
Contributors to this page
Uros Durdevic
Last updated