JavaScript otrzymuj godzinę od daty
var myDate = new Date(2019, 11, 24, 10, 33);
var hour = myDate.getHours();
Binary Snoopy
var myDate = new Date(2019, 11, 24, 10, 33);
var hour = myDate.getHours();
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
const birthday = new Date('March 13, 08 04:20');
console.log(birthday.getHours());
// expected output: 4