Gets the year using Universal Coordinated Time (UTC).
SyntaxdateObj.getUTCFullYear()
Return Value
Returns the year as a four-digit number. 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", getUTCFullYear returns "1912".
ExamplesThe following example shows how to use the getUTCFullYear method.
var date = new Date("1/9/36");
document.write(date.getUTCFullYear());
Remarks
The required dateObj reference is a Date object. To get the year using local time, use the getFullYear 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