-
This is a question / proposal that may be useful for those who come from using chrono's For example, I have this: This does not deserialize, it gives an error of the type Perhaps it would be interesting that if the system encounters such a string it assumes that the timezone is On the other hand, can you think of a simple way to currently deserialize such strings in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Side note: The assumption that the timezone is UTC is for the sake of simplicity. The standard actually accepts that this field (the timezone) does not exist and indicates that in that case the date should be taken as local. Here is more information. |
Beta Was this translation helpful? Give feedback.
-
The error is correct, as an explicit UTC offset must be provided. |
Beta Was this translation helpful? Give feedback.
The error is correct, as an explicit UTC offset must be provided.
NaiveDateTime
inchrono
is equivalent toPrimitiveDateTime
intime
. UTC is not assumed, as aPrimitiveDateTime
does not have a concept of UTC offsets.OffsetDateTime
does, but does not have a default offset. While the specification does seem to indicate (it's not 100% clear) that it should fall back to the local offset, this is highly error prone in practice, not to mention the fact that it would fail in multi-threaded environments on some systems.