JavaScript getUTCFullYear() Method
Example
Return the year, according to universal time:
var d = new Date();
var n = d.getUTCFullYear();
Try it Yourself »
Definition and Usage
The getUTCFullYear() method returns the year (four digits for dates between year 1000 and 9999) 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.
Browser Support
Method | |||||
---|---|---|---|---|---|
getUTCFullYear() | Yes | Yes | Yes | Yes | Yes |
Syntax
Date.getUTCFullYear()
Parameters
None |
Technical Details
Return Value: | A Number, representing the year |
---|---|
JavaScript Version: | ECMAScript 1 |
More Examples
Example
Return the UTC year of a specific date:
var d = new Date("July 21, 1983 01:15:00");
var n = d.getUTCFullYear();
Try it Yourself »
Related Pages
JavaScript Tutorial: JavaScript Dates
JavaScript Tutorial: JavaScript Date Formats
JavaScript Tutorial: JavaScript Date Get Methods