Skip to content

Latest commit

 

History

History
16 lines (9 loc) · 325 Bytes

get-the-full-year.md

File metadata and controls

16 lines (9 loc) · 325 Bytes

How to Get the Full Year


In JavaScript, the .getFullYear() method returns the year of the given date.

const today = new Date()

const fullYear = today.getFullYear()

console.log(fullYear) // 2022

link