You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Deserialize Trait can't deserialize DateTimes from timestamps despite the error message you get. I tried tracking it down in the source code, I hope the cited references are correct.
The Deserialize Trait only calls the deserialize_str() function
The text was updated successfully, but these errors were encountered:
jmaximusix
changed the title
Deserializing from a unix timestamp is not implemented, despite description
Deserializing DateTime from unix timestamp is not implemented, despite description
Mar 4, 2024
That error message, "a formatted date and time string or a unix timestamp", seems not right indeed.
We do not really have a solution yet. There is an old PR to add deserializing from strings to the existing timestamp deserializers (#926). And another one to add full string serialization and deserialization modules (#1067).
The Deserialize Trait can't deserialize DateTimes from timestamps despite the error message you get. I tried tracking it down in the source code, I hope the cited references are correct.
The Deserialize Trait only calls the
deserialize_str()
functionchrono/src/datetime/serde.rs
Lines 75 to 82 in f4adc28
where, in spite of the
expecting()
stating it accepts "a formatted date and time string or a unix timestamp" it only calls theparse()
functionchrono/src/datetime/serde.rs
Lines 53 to 66 in f4adc28
which in turn is implemented to only try and deserialize rfc3339 strings
chrono/src/format/parse.rs
Lines 523 to 534 in f4adc28
The text was updated successfully, but these errors were encountered: