DateTime<Local> doesnt impl serde::Serialize

It looks like DateTime<Tz> impls serde::Serialize, but not DateTime<Local>

the trait `distribution::_IMPL_DESERIALIZE_FOR_Distribution::_serde::Serialize` is not implemented for `chrono::datetime::DateTime<chrono::offset::local::Local>`

Is this an oversight, is there some magic to get it to work, or...?

You can't serialize a DateTime<Local> because there is no timezone information. If you wish to store a raw date without timezone information, use a NaiveDateTime.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.