Code to go logo
Created using Figma
Use Cases
Contribute
How to get current year in JavaScript
Datetime
By Jad Joubran ·
Last updated Jan 04, 2018
const date = new Date(); const year = date.getFullYear();
2018
Jan 04, 2018
1
Jad Joubran
See answer
1
Jad Joubran
Date.getFullYear
on MDN
Learn JavaScript step by step
Related use cases
How to get current day name in JavaScript
How to get current month name in JavaScript