momentJS date string add 5 days

前端 未结 9 1838
死守一世寂寞
死守一世寂寞 2020-12-23 09:03

i have a start date string \"20.03.2014\" and i want to add 5 days to this with moment.js but i don\'t get the new date \"25.03.2014\" in the alert window.

here my j

9条回答
  •  庸人自扰
    2020-12-23 09:08

    updated:

    startdate = "20.03.2014";
    var new_date = moment(startdate, "DD-MM-YYYY").add(5,'days');
    
    alert(new_date)
    

提交回复
热议问题