This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

JS setFullYear()

The setFullYear() method sets the year of a date object:

const d = new Date();
d.setFullYear(2020);
document.getElementById("demo").innerHTML = d;