Bug 188001 - Erroneous date calculation when daylight savings transition occurs during midnight
Summary: Erroneous date calculation when daylight savings transition occurs during mid...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-25 06:13 PDT by Tiago Engel
Modified: 2019-03-14 20:26 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>