time-iso8601

Crates.iotime-iso8601
lib.rstime-iso8601
version0.1.0
sourcesrc
created_at2024-04-15 17:14:36.539818
updated_at2024-04-15 17:14:36.539818
descriptionSerialize and deserialize date-time in ISO-8601 format
homepage
repositoryhttps://github.com/zignis/time-iso8601.git
max_upload_size
id1209465
size4,039
Coro (zignis)

documentation

README

time-iso8601

Serializes and deserializes OffsetDateTime from the time crate in 4-digit year format with 2-digit time precision to work with the majority of web frameworks.

Examples

use serde::{Serialize, Deserialize};
use time::OffsetDateTime;

#[derive(Debug, Serialize, Deserialize)]
struct User {
    #[serde(with = "time-iso8601")]
    datetime_field: OffsetDateTime,
    #[serde(with = "time-iso8601::option")]
    optional_field: Option<OffsetDateTime>,
}
Commit count: 4

cargo fmt