Incrementing a date in JavaScript

后端 未结 17 2152
余生分开走
余生分开走 2020-11-22 05:15

I need to increment a date value by one day in JavaScript.

For example, I have a date value 2010-09-11 and I need to store the date of the next day in a JavaScript v

17条回答
  •  情歌与酒
    2020-11-22 06:04

    Tomorrow in one line in pure JS but it's ugly !

    new Date(new Date().setDate(new Date().getDate() + 1))
    

    Here is the result :

    Thu Oct 12 2017 08:53:30 GMT+0200 (Romance Summer Time)
    

提交回复
热议问题