javascript hour minutes from minutes code example
Example 1: javascript hours minutes seconds
var myDate = new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
console.log(myDate)
//using regex
Example 2: javascript get hour from date
var myDate = new Date(2019, 11, 24, 10, 33);
var hour = myDate.getHours();