-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialization/deserialization does not round trip #45
Comments
In general it's probably a bad idea to serialize anything other than UTC times, as the actual "true" time can change when local governments change their DSTs or make arbitrary adjustments. So, yes, you should only ever serialize Utc and a separate timezone. That said, this should roundtrip and I'd consider this a bug. I'd be happy to take a PR that changes the serialization of timezones to the full name. Tz deserialization may still fail if the tz database is different on the computer deserializing the dt, but at least it will be possible. |
Related to #44 |
I'll ask here since this is the only deserialization issue I found related to chrono_tz. Is there a reason why Tz cannot be deserialized? It's all Continent/City combinations. Is there a reason why this wouldn't work? |
It would be really nice if we could get this. I would like to serialize/deserialize just for some testing fixtures and missing this complicates things a lot |
|
Could you point me to the feature? I don't see it listed here https://github.com/chronotope/chrono-tz/blob/main/chrono-tz/Cargo.toml |
It is an implicit feature from the optional dependency. |
I've come across this issue in particular a couple of times when trying to figure out a solution just to check I wasn't confused. I assume the issue of Do we know if the |
Just realised, that's a really dumb idea from me as it'd create a circular dependency 🤦 |
Right now I can serialize a
DateTime<Tz>
, but I cannot Deserialize it.produces "2020-05-01T04:45:00MDT"
but
gives a compile error
Is there any way for me to keep the
Tz
information when passing from server to frontend(WASM) in one value? or do I have to pass theTz
separate with aNaiveDateTime
?The text was updated successfully, but these errors were encountered: