:+1: We're going to have to use this approach mentioned in the documentation:
Although a
SystemTimecannot be directly inspected, theUNIX_EPOCHconstant is provided in this module as an anchor in time to learn information about aSystemTime. By calculating the duration from this fixed point in time, a SystemTime can be converted to a human-readable time, or perhaps some other string representation.
@jplatte for now can you use chrono::DateTime which already supports Serde serialization to ISO 8601?
@dtolnay Thanks for the pointer, I actually like the explicitness of that API, I'll happily use it, not just temporarily. However, it doesn't seem to be supported in the latest crates.io release of serde (0.8.6), I get
the trait bound `chrono::DateTime<chrono::Local>: serde::Deserialize` is not satisfied
(same if I try UTC)
@jplatte they make you opt into Serde support because not everybody wants it:
[dependencies]
chrono = { version = "0.2", features = ["serde"] }
Ah, thanks again, now it works! :)
Would also be nice to support std::time::Instant as well.
Most helpful comment
Would also be nice to support
std::time::Instantas well.