JavaScript Date getUTCFullYear() Method
- Previous Page getUTCDay()
- Next Page getUTCHours()
- Go to the Previous Level JavaScript Date Reference Manual
Definition and Usage
getUTCFullYear()
The method returns a four-digit number representing the year according to world time (UTC) (a four-digit number between 1000 and 9999).
When calculating dates, the UTC method assumes that the date object is local time and date.
Tip:Coordinated Universal Time (UTC) is the standard time set by the world time standard.
Note:UTC time is the same as GMT time.
Instance
Example 1
Returns the year according to world time:
var d = new Date(); var n = d.getUTCFullYear();
Example 2
Returns the UTC year of a specific date:
var d = new Date("July 21, 1983 01:15:00"); var n = d.getUTCFullYear();
Syntax
Date.getUTCFullYear()
Parameters
No parameters.
Technical Details
Return Value: | Returns the year as a four-digit integer in the world time representation of the dateObject, not a two-digit abbreviation. |
---|---|
JavaScript Version: | ECMAScript 1 |
Browser Support
Method | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
getUTCFullYear() | Support | Support | Support | Support | Support |
Related Pages
Tutorial:JavaScript Date
Tutorial:JavaScript Date Format
Tutorial:JavaScript Object Constructor
- Previous Page getUTCDay()
- Next Page getUTCHours()
- Go to the Previous Level JavaScript Date Reference Manual