Javascript日期,这是我的错误还是发现错误?
我的应用程序中有一部分简单的Javascript,其中有一个链接添加日,其中添加了1天的日期。它总是工作完美,除非日期是11/07/2010,然后链接突然不再工作了。它真的很厉害,因为它只挂在11/07/2010的具体日期。
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 11/07/2010, and then the link suddenly will not work any longer. Its really wierd, because it only hangs up on the specific date of 11/07/2010.
如何复制错误:
- 导航到页面这里
- 在任何日期字段中,点击今天,或者将日期设置为今天。
- 点击添加日 直到你到11/07/2010
- 现在点击添加日不再工作了!
- Navigate to the page here
- On any date field, click "Today", or just set the date to today.
- Click "Add Day" until you get to 11/07/2010
- Now clicking "Add Day" does not work anymore!
问题是你要添加24个小时才能添加一天;夏令时间阻止了您,因为11月7日00:00后24小时将在11月7日23:00(第二次)。
The problem is that you're adding the 24 hours to the date to add one day; Daylight Savings Time has thwarted you because 24 hours after 00:00 on November 7th will be 23:00 (for the second time) on November 7th.