Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zignis/time-iso8601
Serialize and deserialize date-time in ISO-8601 format
https://github.com/zignis/time-iso8601
iso8601 serde time
Last synced: 27 days ago
JSON representation
Serialize and deserialize date-time in ISO-8601 format
- Host: GitHub
- URL: https://github.com/zignis/time-iso8601
- Owner: zignis
- License: mit
- Created: 2024-04-15T17:11:22.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-15T17:14:49.000Z (7 months ago)
- Last Synced: 2024-09-17T14:57:53.370Z (about 2 months ago)
- Topics: iso8601, serde, time
- Language: Rust
- Homepage: https://crates.io/crates/time-iso8601
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# time-iso8601
Serializes and deserializes [`OffsetDateTime`](https://docs.rs/time/latest/time/struct.OffsetDateTime.html) from the
[`time`](https://docs.rs/time) crate in 4-digit year format with 2-digit time precision to
work with the majority of web frameworks.# Examples
```rust
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,
}
```