typeshare icon indicating copy to clipboard operation
typeshare copied to clipboard

Special Rust Type: DateTime

Open LuminaSapphira opened this issue 2 years ago • 1 comments

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.

LuminaSapphira avatar Dec 14 '22 16:12 LuminaSapphira

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.

HHogg avatar Apr 26 '23 22:04 HHogg