JavaScript · Dates and internationalisation

date.getFullYear()

Reads the local year. getMonth is zero-based, so January is 0.

Syntax
date.getFullYear()

Example

Try it

More in this group

Date arithmetic Date.now() date.toISOString() date.toLocaleDateString() Intl.DateTimeFormat new Date()

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course