programming-examples/js/Date/Write a JavaScript function to add specified minutes to a Date object..js
2019-11-15 12:59:38 +01:00

4 lines
169 B
JavaScript

var add_minutes = function (dt, minutes) {
return new Date(dt.getTime() + minutes*60000);
}
console.log(add_minutes(new Date(2014,10,2), 30).toString());