Favorites

JavaScript Date.prototype.getFullYear() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Date.prototype.getFullYear()
JavaScript Date Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The getFullYear() method returns the year of a date, as a four-digit number, in local time.

Description

The getFullYear() method returns the year of the date according to local time. Use it instead of the old getYear(), which returns the year minus 1900. getUTCFullYear() returns the year in UTC.

Like the other get...() methods without "UTC" in their name, it uses the time zone of the user's device, so the same moment can give different results for users in different places. Each has a getUTC...() counterpart for UTC, and for showing a date in a particular time zone, toLocaleString() with the timeZone option is the easiest approach.

It returns NaN for an invalid date. Comparing years alone is a simple way to check things like whether a date falls in the current year, or to calculate an approximate age.

Syntax

date.getFullYear()

Return Value

The four-digit year in local time.

Example

const d = new Date();
console.log(d.getFullYear());
console.log('© ' + new Date().getFullYear() + ' My Site');

Browser Support

The following information will show you the current browser support for the Date.prototype.getFullYear() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee