Easy Tutorial
❮ Met Win Open Prop Video Volume ❯

JavaScript getUTCHours() Method

JavaScript Date Object

Example

Return the hour of the time based on the Universal Coordinated Time (UTC):

n Output result:


Definition and Usage

The getUTCHours() method returns the hour of the time based on Universal Coordinated Time (UTC).

Universal Coordinated Time (UTC) is a time standard based on atomic time, closely approximating mean solar time at the prime meridian (0° longitude).

Note: UTC, also known as Universal Coordinated Time, World Standard Time, or International Coordinated Time, is abbreviated as UTC.

Important: UTC time is the same as Greenwich Mean Time (GMT).


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 extract the UTC hour from a specific date and time:

n Output result

Display the current UTC time


JavaScript Date Object

❮ Met Win Open Prop Video Volume ❯