javascript date + 1

后端 未结 7 1321
逝去的感伤
逝去的感伤 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 03:11

    You have to use the getDate() and setDate() methods of the Date object which respectively get and set the day value of the date.

    var date = new Date();
    date.setDate(date.getDate() + 1);
    

    Check the MDC Date object reference for more information on working with dates

    0 讨论(0)
提交回复
热议问题