-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Daylight savings time not handled properly in America/Santigo. #1121
Comments
Thank you for reporting this! We are looking into it. |
I investigated the issue a bit. Here are my findings. The bug with time correctness stems from Hermes' implementation of The newer ECMAScript standard such as ES13 correctly updated the procedures dealing with timezone conversion. The new spec combines The question becomes how to update the implementation in Hermes to the newer spec. There are two conversions to deal with: UTC to localtime, and localtime to UTC. UTC to localtime is unambiguous. We can use the standard library However, the tricky one is the localtime to UTC conversion. The standard library
For Santiago in 2023, there is a rollback of 1 hour on April 2 midnight, and there is a move forward of 1 hour on September 3 midnight. The example given in this issue is for Sep 3, but there is the same issue to deal with for Apr 2. For example, 11:30 PM on Apr 1 repeats multiple times. First time in UTC-03, then after Apr 2 midnight hits, 11:30 PM on Apr 1 will happen again but this time in UTC-04. The spec says for the conversion, the offset should be treated as if UTC-03 is the offset.
Based on this finding, it seems to me that in order to implement the timezone conversion semantic according to ECMAScript spec, it might be necessary to use the IANA timezone data. Standard library functions don't seem to be sufficient. |
Hello all. Thanks for all the hard work you're putting into Hermes. I understand this issue has spidering consequences / is complex to fix - just curious if there are any updates on it? |
Hello everyone, anyone has found any possible solution or workaround? I'm facing the same issue |
Is there a solution for this issue? as a temporary measure, we are considering disabling Hermes until the problem is resolved. We are unsure if versions of Hermes later than RN 0.71.x fix this issue. another related issues: |
Bug Description
Dates set to midnight of the day of a DST transition in Chile get moved to the prior day at 11 vs the intended day at 1am.
This is inconsistent with the behavior of other runtimes - there may be further similar issues with other timezones.
gradle clean
and confirmed this bug does not occur with JSCHermes version: current
React Native version (if any): 0.71.8
OS version (if any): os x, ios, android
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): arm64-v8a
Steps To Reproduce
America/Santiago
This will output:
Expected behaviour
On v8 / jsc you see the following:
As is this causes the popular date-fns library to spin into an infinite loop in some cases.
See this function for an example: https://github.com/date-fns/date-fns/blob/main/src/eachDayOfInterval/index.ts
If you're in
America/Santiago
the following will loop forever:The text was updated successfully, but these errors were encountered: