javascript date + 1

后端 未结 7 1319
逝去的感伤
逝去的感伤 2020-12-29 02:34

How do I take today\'s date and add 1 day to it?

If possible, inline please?

7条回答
  •  囚心锁ツ
    2020-12-29 02:56

    Try this:

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

提交回复
热议问题