Bug 188001

Summary: Erroneous date calculation when daylight savings transition occurs during midnight
Product: WebKit Reporter: Tiago Engel <tiagohngl>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, beidson, fpizlo, h, msaboff, splaktar, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 11   
Hardware: Unspecified   
OS: Unspecified   

Description Tiago Engel 2018-07-25 06:13:55 PDT
Steps to reproduce:

- Set your system's timezone to BRT (Brasilia time)
- type in new Date(2018, 10, 4) in the console

Expected result (this is what latest Chrome and Firefox return):
Sun Nov 04 2018 01:00:00 GMT-0200 (-02)

Actual result:
Sat Nov 03 2018 23:00:00 GMT-0300 (-03)

The same thing happens when calling `setHours(0, 0, 0, 0)` on `Nov 04 2018`. It goes back to `Nov 3 2018`.


V8 bug: https://bugs.chromium.org/p/v8/issues/detail?id=3116
Comment 1 Michael Prentice 2019-03-14 13:09:26 PDT
We've had reports of this from users of AngularJS Material as well. Some additional details can be found in https://github.com/angular/material/issues/11506. It's a pretty serious issue for users of Safari on macOS and iOS in Brazil.

Also from that issue you can find that:
This issue is still a problem on "Safari on iPhone 7 iOS 12.1 and mac mini with macOS High Sierra and Safari 12.0.1."
Comment 2 Michael Prentice 2019-03-14 13:13:07 PDT
DST ended in Brazil on Feb 17th, 2019, but this will be a problem again on Nov 3rd, 2019 when Brazilian DST starts again (reference https://www.timeanddate.com/time/change/brazil).
Comment 3 Radar WebKit Bug Importer 2019-03-14 20:26:21 PDT
<rdar://problem/48913742>