How can I add 1 day to current date?

后端 未结 6 1796
温柔的废话
温柔的废话 2020-11-22 01:13

I have a current Date object that needs to be incremented by one day using the JavaScript Date object. I have the following code in place:

var ds = stringFor         


        
6条回答
  •  有刺的猬
    2020-11-22 01:56

    To add one day to a date object:

    var date = new Date();
    
    // add a day
    date.setDate(date.getDate() + 1);
    

提交回复
热议问题