English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
getFullYear()The method returns the year of the specified date object based on local time (returns four digits for four-digit years).
getFullYear()The returned value is an absolute number.
For dates between1000 and9999dates between the yearsgetFullYear()Returns a four-digit number, such as1992.
date.getFullYear()
var d = new Date(); d.getFullYear();Test and see‹/›
All browsers fully support the getFullYear() method:
Method | |||||
getFullYear() | Yes | Yes | Yes | Yes | Yes |
Return Value: | A number representing the year |
---|---|
JavaScript Version: | ECMAScript 1 |
Return the year of a specific date:
var d = new Date('August 20, 1999 23:15:30'); d.getFullYear();Test and see‹/›