Module timestamp

Source
Available on crate feature serde only.
Expand description

Treat an OffsetDateTime as a Unix timestamp for the purposes of serde.

Use this module in combination with serde’s #[with] attribute.

When deserializing, the offset is assumed to be UTC.

Modules§

microseconds
Treat an OffsetDateTime as a Unix timestamp with microseconds for the purposes of serde.
milliseconds
Treat an OffsetDateTime as a Unix timestamp with milliseconds for the purposes of serde.
nanoseconds
Treat an OffsetDateTime as a Unix timestamp with nanoseconds for the purposes of serde.
option
Treat an Option<OffsetDateTime> as a Unix timestamp for the purposes of serde.

Functions§

deserialize
Deserialize an OffsetDateTime from its Unix timestamp
serialize
Serialize an OffsetDateTime as its Unix timestamp