Returns the date's hours as a number between 0 and 23.
var myDate = new Date(); console.log(myDate.getHours());
The code above generates the following result.