how to get next week date in javascript

前端 未结 7 1493
不知归路
不知归路 2020-12-08 19:21

Does anyone know how can I get next week date based on this week date? example if I have this thursday date (25/6/2009) how can I use javascript to get next thursday date (2

7条回答
  •  时光说笑
    2020-12-08 20:02

    An even more straightforward solution is

    let nextWeek = new Date()
    nextWeek.setDate(nextWeek.getDate() + 7)
    

    Note that it preserves the current time of day.

提交回复
热议问题