-
Notifications
You must be signed in to change notification settings - Fork 58
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
How to get more information about a timezone like start of DST and offset of DST? #130
Comments
In general, there's no fixed start date/time per timezone -- those things can change from year to year. What is the problem you are trying to solve? |
I'm trying to convert old c++ code directly to rust as closely as possible to avoid regression and then later to convert to idiomatic rust. In any case, I'd like to be able to avoid having to rewrite this datetime management part of code so that it doesn't need information such as "dst offset" and "local dst start time". I understand it's year based but as I understand this boost code can read this from tzfile, is that correct? |
Maybe you should go to one level lower and look directly for crates that parse tzinfo files? |
ok but is providing boost equivalent tz api something chrono might want to do? |
I don't think we will implement APIs that provide a DST offset or local DST start time without some kind of date/time input. I would be willing to review a PR that adds some kind of API where |
I'm trying to convert some old c++ code to rust but I'm lacking some information about the timezones. For instance:
I know I can get offset from UTC if I have some datetime but I would prefer if I wouldn't have to iterate through all days of year and then hours of that day to find when does a certain DST start or end. I see c++ boost has these methods, is there a way to extract this information? From what I can see in boos code they are extracting this data from some string but I didn't find what they are parsing.
I need stuff like
dst_offset
https://github.com/dials/boost/blob/master/boost/date_time/local_time/posix_time_zone.hpp#L177 anddst_local_start_time
https://github.com/dials/boost/blob/master/boost/date_time/local_time/posix_time_zone.hpp#L152The text was updated successfully, but these errors were encountered: