Calculate Date with start date and number of days with javascript

前端 未结 4 1708
予麋鹿
予麋鹿 2021-01-27 12:51

I am trying to calculate a date from a start date and number of days, so basicly add the number of days to a start date and get an end date. The issue is I get some strange res

4条回答
  •  清歌不尽
    2021-01-27 13:23

    On October 28th the time changes from DST to "normal", so the day is not equal 24h. That may cause issues in your code.

    Also why (days-1) * 24 * 60 * 60 * 1000? If you set days to 1 the whole expression evaluates to zero...

提交回复
热议问题