date.setDate across DST boundary changes timezone
Reported by
michael2...@gmail.com,
Nov 20 2017
|
||||
Issue description
Steps to reproduce the problem:
Can be reproduced in the console (remote debugging) with the following code:
1. Create a new Date some time after a daylight saving time change:
t = new Date("2017/11/20")
2. Now set the day of the month to some time before the daylight saving change.
t.setDate(5)
3. Observe the date object
What is the expected behavior?
I expect the time to be the same and only the date to change.
What went wrong?
The timezone is changed:
> t = new Date("2017/11/20")
Mon Nov 20 2017 00:00:00 GMT-0700 (MST)
> t.setDate(5)
1509861600000
> t
Sun Nov 05 2017 00:00:00 GMT-0600 (MDT)
In the above example, the timezone was changed from Mountain Standard Time to Mountain Daylight Time.
I don't know if this is expected behavior if in a time zone that observes DST (it certainly messed up date arithmetic if it is!), but it certainly is a bug in a time zone that does NOT observe DST, as was the case here!
Did this work before? N/A
Chrome version: 62.0.3202.84 Channel: stable
OS Version: 7.1.2
Flash Version:
I have tested this code and this bug does not exist in the desktop version of Chrome, e.g. 61.0.3163.100 under Windows 10.
,
Nov 21 2017
,
Nov 21 2017
@michael2718: Thanks for the report!! Could you please help us with the sample file where you're seeing this issue and attach a screencast from you end as well, Which would help us in further triaging of the issue. Thanks!!
,
Jan 29 2018
Closing this issue due to lack of feedback from reporter. Please feel free to file a new issue if the issue is still observed in latest Chrome #64.0.3282.123. Thanks! |
||||
►
Sign in to add a comment |
||||
Comment 1 by dtapu...@chromium.org
, Nov 20 2017