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:
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
Dateclass is using the current values for DST that were enacted by the Energy Policy Act of 2005. See here: