Return the year, according to universal time:
The output of the code above will be:
The getUTCFullYear() method returns the year (four digits) of the specified date, according to universal time.
The UTC methods calculate their date assuming that the date object is of local time and date.
Tip: The Universal Coordinated Time (UTC) is the time set by the World Time Standard.
Note: UTC time is the same as GMT time.
Method | |||||
---|---|---|---|---|---|
getUTCFullYear() | Yes | Yes | Yes | Yes | Yes |
None |
Return Value: | A Number, representing the year (four digits) |
---|---|
JavaScript Version: | 1.3 |
Return the UTC year of a specific date:
The result of n will be: