js get hour and minute from date code example

Example 1: javascript get hour from date

var myDate = new Date(2019, 11, 24, 10, 33);
var hour = myDate.getHours();

Example 2: new Date() get speicifc hours min sec

new Date().getDate()          // Get the day as a number (1-31)
new Date().getDay()           // Get the weekday as a number (0-6)
new Date().getFullYear()      // Get the four digit year (yyyy)
new Date().getHours()         // Get the hour (0-23)
new Date().getMilliseconds()  // Get the milliseconds (0-999)
new Date().getMinutes()       // Get the minutes (0-59)
new Date().getMonth()         // Get the month (0-11)
new Date().getSeconds()       // Get the seconds (0-59)
new Date().getTime()          // Get the time (milliseconds since January 1, 1970)

Example 3: js date get hours

const birthday = new Date('March 13, 08 04:20');

console.log(birthday.getHours());
// expected output: 4