Gets the year, using local time.
SyntaxdateObj.getFullYear()
Return Value
The year as a four-digit number. For example, the year 1976 is returned as 1976. Years specified as two digits in the Date constructor or in setFullYear are assumed to be in the twentieth century, so given "5/14/12", getFullYear returns "1912".
ExamplesThe following example illustrates the use of the getFullYear method.
var date = new Date("1/1/01");
document.write(date.getFullYear());
Remarks
The required dateObj reference is a Date object. To get the year using Universal Coordinated Time (UTC), use the getUTCFullYear method.
See also Other articles AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4