RESOLVED FIXED204032
UTC offset for Samoa is miscalculated when !HAVE(TIMEGM)
https://bugs.webkit.org/show_bug.cgi?id=204032
Summary UTC offset for Samoa is miscalculated when !HAVE(TIMEGM)
Ross Kirsling
Reported 2019-11-08 16:53:53 PST
UTC offset for Samoa is miscalculated when !HAVE(TIMEGM)
Attachments
Patch (1.61 KB, patch)
2019-11-08 16:57 PST, Ross Kirsling
no flags
Patch (5.62 KB, patch)
2019-11-11 15:48 PST, Ross Kirsling
no flags
Ross Kirsling
Comment 1 2019-11-08 16:57:28 PST
Ross Kirsling
Comment 2 2019-11-08 17:05:33 PST
Not sure if this is possible to test, but repro scenario on Mac is the following: 1. Set system time zone to that of Apia, Samoa. 2. Notice that `new Date().getTimezoneOffset() / -60` is 13 or 14. 3. Change #if HAVE(TIMEGM) and #if HAVE(TM_GMTOFF) to #if 0 in DateMath.cpp. 4. Notice that `new Date().getTimezoneOffset() / -60` is now -10 or -11.
Ross Kirsling
Comment 3 2019-11-08 17:14:18 PST
Also, please feel free to counter-suggest a more sustainable solution. :P
Yusuke Suzuki
Comment 4 2019-11-08 20:46:50 PST
Comment on attachment 383181 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383181&action=review > Source/WTF/ChangeLog:9 > + but Samoa changed from UTC-11 to UTC+13 at the beginning of 2012. Let's write a test by setting `TZ=Pacific/Samoa`! You can extend run-jsc-stress-tests, maybe, extending runComplexTest, and pass environment variables as additionalEnv. And specify it from `complex.yaml` in JSTests.
Ross Kirsling
Comment 5 2019-11-11 13:27:15 PST
(In reply to Yusuke Suzuki from comment #4) > Comment on attachment 383181 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=383181&action=review > > > Source/WTF/ChangeLog:9 > > + but Samoa changed from UTC-11 to UTC+13 at the beginning of 2012. > > Let's write a test by setting `TZ=Pacific/Samoa`! > You can extend run-jsc-stress-tests, maybe, extending runComplexTest, and > pass environment variables as additionalEnv. And specify it from > `complex.yaml` in JSTests. Can do. By the way, it turns out Pacific/Samoa is for American Samoa, which is still UTC-11; I guess the one we need here is Pacific/Apia. Talk about confusing! (https://en.wikipedia.org/wiki/Time_in_Samoa)
Ross Kirsling
Comment 6 2019-11-11 15:48:25 PST
Yusuke Suzuki
Comment 7 2019-11-11 16:30:04 PST
Comment on attachment 383307 [details] Patch r=me
WebKit Commit Bot
Comment 8 2019-11-11 16:58:47 PST
Comment on attachment 383307 [details] Patch Clearing flags on attachment: 383307 Committed r252345: <https://trac.webkit.org/changeset/252345>
WebKit Commit Bot
Comment 9 2019-11-11 16:58:49 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2019-11-11 16:59:23 PST
Note You need to log in before you can comment on or make changes to this bug.