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

Smartphone icons created by Freepik - Flaticon

JavaScript Dates

The getFullYear() Method

Return the full year of a date object:

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