I have below format of date and need a beloe o.p in momen
var myDate="2019-01-26";
console.log(moment(myDate,'YYYY-MM-DD 00:00:00').add("2019-01-26 04:00");
expected o/p be 2019-01-26 04:00:00
I have below format of date and need a beloe o.p in momen
var myDate="2019-01-26";
console.log(moment(myDate,'YYYY-MM-DD 00:00:00').add("2019-01-26 04:00");
expected o/p be 2019-01-26 04:00:00
Based on this, and your previous similar questions it seems that you are trying to add a specific amount of time to a moment-defined date. Perhaps the solution is simpler than you expect. The "add" method takes two arguments; a number representing the quantity to be added, and the type of unit (weeks, days, hours, etc.)
var myDate="2019-01-26";
console.log(moment(myDate,'YYYY-MM-DD 00:00:00').add(4, "hours");
seems to return the value you are looking for. the momentjs documentation is excellent. https://momentjs.com/docs/