Web platform features explorer

getYear() and setYear()

Discouraged
Tags: javascript Groups: JavaScript

The getYear() and setYear() methods of Date objects get and set the year as an offset to 1900.

Learning resources on MDN

Browser support