Javascript date, is this my error or did I find a bug?

后端 未结 3 1550
旧时难觅i
旧时难觅i 2021-01-18 03:55

I have a section of simple Javascript in my application that has a link \"Add Day\", which adds 1 day to a date. It always works perfectly, except when the date gets to be

3条回答
  •  天命终不由人
    2021-01-18 04:16

    Daylight Savings Time. (In most places in the US) the time rolls back on the first Sunday of November. Your code is just adding an amount of milliseconds to the start of the day specified by the input box, and the returning the beginning of the resulting day: however because of DST, simply adding seconds and truncating the date this way will never progress the date.

提交回复
热议问题