js get hour minute second code example
Example 1: javascript get hour from date
var myDate = new Date(2019, 11, 24, 10, 33);
var hour = myDate.getHours();
Example 2: javascript get 1 hour from now
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
Example 3: new Date() get speicifc hours min sec
new Date().getDate()
new Date().getDay()
new Date().getFullYear()
new Date().getHours()
new Date().getMilliseconds()
new Date().getMinutes()
new Date().getMonth()
new Date().getSeconds()
new Date().getTime()