JavaScript getUTCHours() Method
Example
Return the hours of a time based on universal time (UTC):
var d = new Date();
var n = d.getUTCHours();
n Output result:
Try it »
Definition and Usage
The getUTCHours() method returns the hours of a time based on universal time (UTC).
Coordinated Universal Time (UTC) is a time measurement system based on the atomic second, designed to stay as close as possible to universal time.
**Tip:** Coordinated Universal Time, also known as Universal Time, World Standard Time, or 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
Date
.getUTCHours()
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 hours from a specific date and time:
var d=new Date("July 21, 1983 01:15:00");
var n=d.getUTCHours();
n Output result
Try it »
Display the current UTC time
How to use getUTCHours(), getUTCMinutes(), and getUTCSeconds() to display the current UTC time.
JavaScript Date object