CEST not understood.
Closed this issue · 5 comments
The string Fri, 21 Aug 2015 18:37:44 CEST
results in the following warning:
tzname CEST identified but not understood. Ignoring for the time being, but behavior is subject to change.
CEST stands for central european summer time.
At the moment, dtparse
only supports named timezones when they're provided in Parser.tzinfos
. Rust's chrono-tz does correctly parse the CEST zone, but the actual type (TzOffset
) isn't part of the public API. That leads to issues when I try to convert the TzOffset
into a FixedOffset
inside build_tzaware
.
I'm going to reach out to chrono-tz
and ask how best to handle this - if I need to do some refactoring work to make use of impl Offset
or something similar, that's totally fine, but I'm a bit surprised that TzOffset
isn't part of the public API. Will update this once I know what the path forward is.
Took a second look at it, turns out I can use TzOffset
anonymously without it needing to be named as part of the public API.
Chrono-tz is now informing me that 'CEST' is not a valid timezone
so I presume that I'm doing something wrong. Still in progress.
EDIT: "EST" (US Eastern) is properly recognized, so now I need to figure out why Chrono thinks this is an invalid timezone. I'm going to go ahead and land my changes in the near future so that once chrono-tz
is updated, dtparse
will automagically pick things up and start working.
Alright, I'm unfortunately going to say that I can't support timezones right now. Couple things I found:
- Chrono-tz doesn't currently support the daylight-savings names for many time zones. "EST" is recognized, but "EDT" isn't. Same for you, "CEST" isn't recognized, but "CET" is.
- There are other correctness issues: see chronotope/chrono-tz#34
- Other (much larger) projects have similar issues: tikv/tikv#4553
Given the above, if you know there are specific timezone names that can be recognized, calling Parser::parse
with your specific tzinfos
would work (in your case, a map of {"CEST": 7200}
would achieve the desired effect). However, until timezone support improves in Rust generally, I can't support it here. Sorry.
Thanks for looking into this! I hope the ecosystem improves over time and makes this possible eventually. I think I am set for the moment using the workaround.
Hi, I was wondering if this was made any easier by the new version of chrono-tz (0.6.0), or if it has the same issue.