Return the year:
The result of n will be:
More "Try it Yourself" examples below.
The getFullYear() method returns the year (four digits) of the specified date.
Method | |||||
---|---|---|---|---|---|
getFullYear() | Yes | Yes | Yes | Yes | Yes |
None |
Return Value: | A Number, representing four digits, representing the year |
---|---|
JavaScript Version: | 1.3 |
Return the year of a specific date:
The result of n will be: