JavaScript Date setFullYear()
JavaScript Date setFullYear()
The setFullYear() method is used for setting the year of a date. We can also set a month and day with it.
Syntax:-
Its syntax is:- Date.setFullYear(year, month, day)
Return:-
Its return is:- number of milliseconds of new date from 1 January, 1970
Further Explanation:-
Parameter | Description |
year | Required. The year. Negative values are allowed. |
month | Optional. The month from 0 to 11. |
day | Optional. The day from 0 to 31. |