I'm pretty sure I'm doing something wrong, but I've simplified my example as much as possible and I can't help but feel like the start/end date for daylight savings time in javascript for certain years is just wrong in my timezone.
I'm in the Pacific Time Zone. Right now it is Pacific Standard time. When I run all the dates in 1989, it says that DST starts on:
Mon Mar 13 1989 00:00:00 GMT-0700 (Pacific Daylight Time)
and it ends on:
Sun Nov 05 1989 00:00:00 GMT-0700 (Pacific Daylight Time)
According to all the sources I could find (including Wikipedia and timeanddate.com), DST was supposed to start on Sunday, April 2, 1989 and end on Sunday, October 29, 1989.
I added a JSFiddle example here:
http://jsfiddle.net/jzFgM/
The code is crude, I know - just trying to give a concrete example. You may need to be in the Pacific Time Zone and on Windows 7 to see the results. It gives me the same "wrong" dates in Chrome, Firefox and IE9.
Why am I seeing these results? I assume it's a simple misunderstanding, but I haven't been able to pinpoint the issue.
The Date class is using the current values for DST that were enacted by the Energy Policy Act of 2005. See here:
The bill amends the Uniform Time Act of 1966 by changing the start and end dates of daylight saving time, beginning in 2007. Clocks were set ahead one hour on the second Sunday of March (March 11, 2007) instead of on the first Sunday of April (April 1, 2007). Clocks were set back one hour on the first Sunday in November (November 4, 2007), rather than on the last Sunday of October (October 28, 2007).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With