The getfullyear() function of date object returns year of the specified date. Use it for example to get year of the specified date.
Syntax