typeshare
typeshare copied to clipboard
Special Rust Type: DateTime
Basics
DateTime types are a stricter representation of a timestamp, and provide a meaningful type declaration than a unix timestamp integer or string. They should be included as a SpecialRustType variant and provide (de)serializers for easy cross-platform date handling.
Details
Currently, there are several options for a Rust DateTime type. The one I suggest using is chrono::DateTime from the chrono crate, because its widely adopted, has builtin (with a feature flag) Serde support, and conforms to ISO 8601, which can be read by other languages.
Just adding my case with dates here. Using NaiveDateTime
, which serializes to a String, at the moment it doesn't get output to anything with typeshare.