Date.getUTCHours()
Returns the hour, according to universal time (from 0-23)
var date1 = new Date('December 31, 1975, 23:15:30 GMT+11:00');
var date2 = new Date('December 31, 1975, 23:15:30 GMT-11:00');
console.log(date1.getUTCHours());
// expected output: 12
console.log(date2.getUTCHours());
// expected output: 10
Syntax
dateObj.getUTCHours()Examples
Using getUTCHours()
getUTCHours()References
Contributors to this page
Last updated