ES6 - getUTCHours() Method


Advertisements


JavaScript date getUTCHours() method returns the hours in the specified date according to universal time. The value returned by getUTCHours is an integer between 0 and 23.

Syntax

Date.getUTCHours ()  

Return Value

Returns the hours in the specified date according to universal time.

Example

var dt = new Date( "December 25, 1995 23:15:20" ); 
console.log("getUTCHours() : " + dt.getUTCHours() );  

Output

getUTCHours() : 17    

es6_date.htm

Advertisements
E-Books Store