JavaScript getUTCHours()Method
Example
Return the hour of the time according to UTC:
var n = d.getUTCHours();
nOutput:
Try it Yourself »
Definition and Usage
The getUTCHours() method returns the hour of the time according to UTC.
Coordinated Universal Time (UTC) is a time measurement system based on the atomic second, which is as close as possible to Universal Time in terms of moments.
Tip:Coordinated Universal Time, also known as Universal Time Coordinated, World Standard Time, International Coordinated Time, abbreviated as UTC (Universal Coordinated Time).
Note:UTC time is the same as GMT (Greenwich) time.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the getUTCHours() method.
Syntax
Return Value
| Type | Description |
|---|---|
| Number | The value is an integer between 0 (midnight) and 23 (11 PM). |
Technical Details
| JavaScript Version: | 1.3 |
|---|
More Examples
Example
Here, we will extract the UTC hour from a specific date and time:
var n=d.getUTCHours();
nOutput
Try it Yourself »
Display the current UTC time
How to use getUTCHours(), getUTCMinutes() and getUTCSeconds() to display the current UTC time.
Other Extensions
JavaScript Date Object