ES6 - getUTCHours() Method



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    

Output

getUTCFullYear() : 1995    
Advertisements