JavaScript getFullYear() Method: Date Object
Description
The getFullYear() method is used to get the year of a given date according to local time.
The value returned by the getFullYear() method is an absolute number. getFullYear() returns a four-digit number (for example, 2010) for dates between the years 1000 and 9999.
Version
Implemented in JavaScript 1.3
Syntax
getFullYear()

Example:
In the following web document, getFullYear() method returns the year of a specified date and current year.
View the example in the browser
Supported Browser
Internet Explorer 7 | Firefox 3.6 | Google Chrome 7 | Safari 5.0.1 | Opera 10 |
Yes | Yes | Yes | Yes | Yes |
See also:
JavaScript Core objects, methods, properties.
Previous: JavaScript getDay() Method: Date Object
Next:
JavaScript getHours() Method: Date Object
Test your Programming skills with w3resource's quiz.