DroidScript

JavaScript Reference

dateObj.getUTCHours()

The getUTCHours() method returns the hours in the specified date according to universal time.

Syntax

dateObj.getUTCHours()

Parameters

None.

Return value

The value returned by getUTCHours() is an integer between 0 and 23.

Examples

Using getUTCHours()

The following example assigns the hours portion of the current time to the variable hours.

var today = new Date();
var hours = today.getUTCHours();

 Created by Mozilla Contributors and licensed under CC-BY-SA 2.5