-
Notifications
You must be signed in to change notification settings - Fork 510
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
TimeZone::datetime_from_str incorrectly fails to parse UNIX timestamps as Impossible #194
Comments
The documentation additionally claims "See also |
In fact, it appears to be impossible to parse a |
Even let ts = NaiveDateTime::parse_from_str("1510427171.572982", "%s%.f")?;
Local.from_utc_datetime(&ts) |
Attempting to manually parse a timestamp, However, Instead of demanding that |
This is indeed a bug in the released chrono (dupe of #175 ), and is fixed in master (5124c0c). If you want to use the updated chrono locally (until @lifthrasiir can release a 0.4.1) I recommend using a [patch.crates-io]
chrono = { git = "https://github.com/chronotope/chrono" } should do it. |
The following code fails to parse with
ParseError(Impossible)
when it shouldn't:There's clearly enough information to parse
1510427171.572982
to a unique datetime in theLocal
timezone, yetchrono
fails. IfLocal.timestamp(0, 0)
produces a validDateTime<Local>
, then there's no reason this example shouldn't as well.The text was updated successfully, but these errors were encountered: