Return the year:
The result of n will be:
The getFullYear() method returns the year (four digits) of the specified date.
![]()
The getFullYear() method is supported in all major browsers.
| Type | Description |
|---|---|
| Number | Four digits, representing the year |
| JavaScript Version: | 1.3 |
|---|
Return the year of a specific date:
The result of n will be:
JavaScript Date Object
Your message has been sent to W3Schools.