-
Notifications
You must be signed in to change notification settings - Fork 15
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
Changes to the system time zone are not visible in macOS #145
Comments
It seems most idiomatic for iOS and macOS apps to use This crate intentionally only binds to Additionally, it doesn't feel great to intentionally subvert the caching put in place by Can you provide more context on the problem you're trying to solve and why invalidating the cache in some other way is not appropriate? Why do we need to add this logic in |
Thanks for raising this bit of nuance! My inclination is to not accept this proposed diff and to instead add some platform specific caveats to the docs for iOS, macOS, and tvOS. |
Maybe the It looks like reading an uncached timezone value could be quite time consuming: CFTimeZone.c. (The file mixes tabs and spaces for indentation, which is not displayed properly in github.) |
I noticed this while debugging a service that checks the current timezone when some event happens; since the caching behaviour is different from the other platforms I tested on, I thought it was not intentional. In my case there are no performance concerns, so I can add a call to If caching is expected on Apple platforms, I agree with your proposal to document the platform-specific bits. |
In macOS, if the system time zone changes while the current process is running,
get_timezone()
returns the previous time zone instead of the current time zone.Reproduction
Run the following program:
While the program is running, change the system time zone (from the Settings UI or using
sudo systemsetup -settimezone
).In MacOS, the programs keeps printing the old time zone.
In Windows and in Linux, the program output reflects the change in system settings.
Proposed fix
The text was updated successfully, but these errors were encountered: