-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
tzdb support #193
Comments
The |
I've just begun implementing support for tz database without relying on chrono dependency. EDIT: link to repository for anyone interested: https://github.com/Yuri6037/time-tz |
Quick update: I've just finished initial version with support for timezone conversions: https://crates.io/crates/time-tz |
Thank you! It's by no means the kind of API that I've envisioned, but having something will hopefully be helpful to others until I get around to this — whenever that may be. |
This is not yet finished. I don't plan to leave the API as it is forever. The reason why it's done this way is because parsing the tz info and setting up the actual lookup code was more complicated than I've anticipated. My plan is to have an API similar to chrono-tz to quickly access the various timezones. If anyone needs features that are not currently supported by time-tz feel free to open issues on the GitHub. |
That's why this issue is |
Just a quick update: I've finally finished API v2 which now allows to very quickly re-implement localtime: let system_tz = time_tz::system::get_timezone()
.expect("Failed to find system timezone");
let localtime = OffsetDateTime::now_utc().to_timezone(system_tz);
// the system timezone name in IANA format is in system_tz.name() now |
Something to keep an eye on/draw inspiration from is unicode-org/icu4x#1003 which is the tracking issue for |
Thanks @LinusU! I am aware of temporal, but I'll definitely check out that issue. |
@Yuri6037 thank you for the crate dude, it's awesome! |
I'd be curious to hear more about where this sits. I've been looking at |
@maxcountryman It's a significant effort that I have worked on on-and-off for a while now. None of the code I've written is public yet. |
This is a general tracking issue for all support related to the IANA Time Zone database.
At some point in the future, my hope is to have full support for the tzdb via a
ZonedDateTime
struct and aPeriod
type.General inspiration could come from C++20's proposed API for timezones [ref]. It should be possible to build a static/const singleton by using a build script.
The text was updated successfully, but these errors were encountered: