Skip to content
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

Use host data from /usr/share/zoneinfo on Unix #73

Open
ijackson opened this issue Oct 15, 2020 · 2 comments
Open

Use host data from /usr/share/zoneinfo on Unix #73

ijackson opened this issue Oct 15, 2020 · 2 comments

Comments

@ijackson
Copy link

Hi.

chrono-tz contains the Olson TZ data (at least, AFAICT, it does on crates.io, although it's not in git). No doubt this is good for Windows where the OS does not provide sensible timezone data.

But on Unix, the OS provides the Olson TZ database directly, generally in /usr/share/zoneinfo. OS updates update it. On Unix it is not right that Rust programs should end up with the timezone data embedded into the program, because if governments change the clocks (which they have been known to do at very short notice) this should be handled by an OS update, not by having to give everyone rebuilt Rust binaries.

So it seems to me that on Unix, chrono-tz should (by default at least) only use data from the OS installed timezone database. Would you be amenable to something like this? It seems to me that the default behaviour should be controlled by a feature flag.

I think implementing this needs an impl of TimeZone for &[parse_zoneinfo::ZoneInfo], or something along those lines.

@quodlibetor
Copy link
Contributor

Yes, I would like this to be supported.

Right now you should be able to use the tzfile crate, although I'm not sure how mature it is.

@ijackson
Copy link
Author

Yes, I would like this to be supported.

Right now you should be able to use the tzfile crate, although I'm not sure how mature it is.

Thanks for the reference! I hadn't found that crate, so pointing me at that is super-useful to me since I my program doesn't run on Windows anyway...

In this Issue I think I am saying, therefore, that chrono-tz should use tzfile (by default) on Unix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants