From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Date Object
The getUTCFullYear() method returns a four-digit number that represents a year according to the Universal Coordinated Time (UTC).
| dateObject.getUTCFullYear() |
Note: This method is always used in conjunction with a Date object.
Tip: The Universal Coordinated Time (UTC) is the time set by the World Time Standard.
Example 1Get the current UTC year:
The output of the code above will be: Try it yourself » |
Example 2Get the UTC year of a specific date:
The output of the code above will be:
Try it yourself » |
JavaScript Date Object
From http://www.w3schools.com (Copyright Refsnes Data)