Open hasezoey opened 1 year ago
I was able to reproduce this issue on branch 0.4.x
and branch main
.
I added this user-provided regression test in PR #1097
https://github.com/chronotope/chrono/pull/902 Should give a better error message here. It will have to wait until 0.5 though, as that is a breaking change.
Currently when trying to format a
NaiveDateTime
withRFC3339
(or to be more specific.format("%+")
), there a very generic error:no mention of that it cannot format because no timezone is provided
from my testing the error comes from: https://github.com/chronotope/chrono/blob/083d3bf196537dfdbce6c29543734022f68e61a4/src/format/mod.rs#L687 because
off
isNone
and results in the following error: https://github.com/chronotope/chrono/blob/083d3bf196537dfdbce6c29543734022f68e61a4/src/format/mod.rs#L697versions: rustc rustc 1.69.0 (84c898d65 2023-04-16) chrono 0.4.24
reproduction code:
possible fixes:
RFC3339
is not supported forNaiveDateTime