From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Date Object
The getUTCHours() method returns the hour of a time according to the Universal Coordinated Time (UTC).
| dateObject.getUTCHours() |
Note: The value returned by getUTCHours() is a two digit number. However, the return value is not always two digits, if the value is less than 10 it only returns one digit.
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 UTC hour of the current time:
Try it yourself » |
Example 2Get the UTC hour from a specific date and time:
Try it yourself » |
More Examples |
Display the current UTC time
How to use getUTCHours(), getUTCMinutes(), and getUTCSeconds() to display the current UTC time.
JavaScript Date Object
From http://www.w3schools.com (Copyright Refsnes Data)