Serialize date from string "yyyy-MM-dd"? #694
-
Is it possible to achieve this? Here's an example (that doesn't work): #[derive(Serialize, Deserialize, Debug)]
pub struct Foo {
pub from: time::Date,
pub to: time::Date,
}
let json = "{ \"from\": \"2024-01-01\", \"to\": \"2024-01-02\"}";
let q: Foo= serde_json::from_str(json).unwrap(); |
Beta Was this translation helpful? Give feedback.
Answered by
jhpratt
Jul 26, 2024
Replies: 1 comment 5 replies
-
What is your |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll want to enable to
serde-human-readable
feature to be able to parse non-binary representations withserde
.