You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've looked into the code a bit, and it seems that it's doing the conversion in two steps. First it converts the time from 2018-03-11T04:00Z to 2018-03-10T20:00-08:00, then it tries to move it into the future by eight hours, which puts it at 2018-03-11T04:00-08:00, which is actually 2018-03-11T05:00-07:00 because of the DST shift.
Yep, I can verify that the bug exists. We could try to extract pieces (year, month, day, hour, minute, second) and re-create a new moment from that, it should work better.
ichernev
changed the title
Converting a moment to another time zone preserving the local time is incorrect near DST transitions
.tz(.., true) incorrect around DST
Aug 26, 2022
Fiddle: https://jsfiddle.net/r3qx7zh9/2/
Output:
It's very strange that the converted moment has different offsets for
toString
andtoISOString
. It stops happening at '2018-03-11T10:00'.The text was updated successfully, but these errors were encountered: