Easy Tutorial
❮ Prop Style Aligncontent Prop Meter Low ❯

JavaScript getFullYear() Method

JavaScript Date Object

Example

Returns a year:

n Output result:


Definition and Usage

The getFullYear() method returns a four-digit number representing the year.


Browser Support

All major browsers support the getFullYear() method.


Syntax

Return Value

Type Description
Number A four-digit number representing the year.

Technical Details

| JavaScript Version: | 1.3 | | --- | --- |


More Examples

Example

Returns the year of a specified date:

n Output result:


JavaScript Date Object

❮ Prop Style Aligncontent Prop Meter Low ❯