How can I add 1 day to current date?

后端 未结 6 1845
温柔的废话
温柔的废话 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 02:09

    If you want add a day (24 hours) to current datetime you can add milliseconds like this:

    new Date(Date.now() + ( 3600 * 1000 * 24))
    

提交回复
热议问题