Closed Bug 883775 Opened 12 years ago Closed 9 years ago

Date() changes incorrectly on DST switch

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ivdoorn, Unassigned)

Details

(Keywords: regressionwindow-wanted, reproducible)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Steps to reproduce: - Set timezone to Europe/Amsterdam - Create Date Object: d = new Date('Mar 26 2011 02:00') - Increment it by one day: new Date(d.setDate(d.getDate() + 1)); Actual results: The end result is that the variable 'd' is 'Sun Mar 27 2011 03:00:00 GMT+0200 (CET) Expected results: Besides the fact that the GMT offse (+02:00) doesn't match the timezone name (CET), which is correctly described in ticket 819820. It should have said: 'Sun Mar 27 2011 01:00:00 GMT+0100 (CET)' Although this sounds like the odd value to return, it is consistent with all other browsers like Google Chrome, Internet Explorer, and the previous versions of Firefox. I've tested Firefox version 17, which does return 'Sun Mar 27 2011 01:00:00 GMT+0100 (CET)' as expected.
OS: Windows 7 → Linux
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Last known-good: Firefox 17. STR: - Set timezone to Europe/Amsterdam - Execute the following script in the console (or the js shell): d = new Date('Mar 26 2011 02:00'); new Date(d.setDate(d.getDate() + 1)).toString(); Actual result: "Sun Mar 27 2011 03:00:00 GMT+0200 (CET)" Expected result: "Sun Mar 27 2011 01:00:00 GMT+0100 (CET)"
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: regressionwindow-wanted, reproducible
Version: 21 Branch → Trunk
Whiteboard: regressionwindow-wanted, reproducible
In Firefox 25 the issue seems to be resolved. So I can only confirm the issue for Firefox 24.
Yep, I can confirm that it works, too. Thanks for testing this, Ivo!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Sorry to reopened this one. But the bug is back. I now see what happened, this bug only occurs during the DST period. Previously I discovered the bug during the DST period. It remained fully reproducible during the period, and was fixed magically after a browser upgrade. However, I now realize, that the browser upgrade had nothing to do with it, it coincided with the DST switch to Winter Time. In other words, since we are now back in Summer Time, the bug reintroduced itself again as well. Which means it is reproducible on Firefox 24.4.0 ESR and 27
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Assignee: general → nobody
Don't we have some kind of caching for this? Does that line up with the rough regression window?
Flags: needinfo?(jdemooij)
(In reply to Till Schneidereit [:till] from comment #1) > Last known-good: Firefox 17. > > STR: > - Set timezone to Europe/Amsterdam > - Execute the following script in the console (or the js shell): > > d = new Date('Mar 26 2011 02:00'); > new Date(d.setDate(d.getDate() + 1)).toString(); > > Actual result: > "Sun Mar 27 2011 03:00:00 GMT+0200 (CET)" > > Expected result: > "Sun Mar 27 2011 01:00:00 GMT+0100 (CET)" Hm, when I set my date back to October (DST) and run this, I get your "Actual result" in both V8/Chrome and SpiderMonkey (V8 says CEST instead of CET, but the rest is the same). What am I missing?
Ivo, can you please respond to comment 6?
Flags: needinfo?(ivdoorn)
Closing this as incomplete due to inactivity and lack of response from the reporter. Feel free to reopen the bug if the issue still reproduces on a current build.
Status: REOPENED → RESOLVED
Closed: 11 years ago9 years ago
Flags: needinfo?(jdemooij)
Flags: needinfo?(ivdoorn)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.