You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**** TIMESTAMPS_AS_MILLISECONDS ****
Instant with nano
java.time.Instant 1714421498936
Instant with milli
java.time.Instant 1714421498936
java.util.Date 1714421498936
Instant without subseconds
java.time.Instant 1714421498000
java.util.Date 1714421498000
Date with nano
java.time.ZonedDateTime 1714421498936
Date with milli
java.time.ZonedDateTime 1714421498936
java.util.GregorianCalendar 1714421498936
Date without subseconds
java.time.ZonedDateTime 1714421498000
java.util.GregorianCalendar 1714421498000
**** TIMESTAMPS_AS_NANOSECONDS ****
Instant with nano
java.time.Instant 1714421498.936155001
Instant with milli
java.time.Instant 1714421498.936000000
java.util.Date 1714421498936
Instant without subseconds
java.time.Instant 1714421498.000000000
java.util.Date 1714421498000
Date with nano
java.time.ZonedDateTime 1714421498.936155001
Date with milli
java.time.ZonedDateTime 1714421498.936000000
java.util.GregorianCalendar 1714421498936
Date without subseconds
java.time.ZonedDateTime 1714421498.000000000
java.util.GregorianCalendar 1714421498000
**** AS_STRING ****
Instant with nano
java.time.Instant "2024-04-29T20:11:38.936155001Z"
Instant with milli
java.time.Instant "2024-04-29T20:11:38.936Z"
java.util.Date "2024-04-29T16:11:38.936-04:00"
Instant without subseconds
java.time.Instant "2024-04-29T20:11:38Z"
java.util.Date "2024-04-29T16:11:38.000-04:00"
Date with nano
java.time.ZonedDateTime "2024-04-29T23:11:38.936155001+03:00"
Date with milli
java.time.ZonedDateTime "2024-04-29T23:11:38.936+03:00"
java.util.GregorianCalendar "2024-04-29T16:11:38.936-04:00"
Date without subseconds
java.time.ZonedDateTime "2024-04-29T23:11:38+03:00"
java.util.GregorianCalendar "2024-04-29T16:11:38.000-04:00"
**** WITH_ZONE_ID ****
Instant with nano
java.time.Instant "2024-04-29T20:11:38.936155001Z"
Instant with milli
java.time.Instant "2024-04-29T20:11:38.936Z"
java.util.Date "2024-04-29T16:11:38.936-04:00"
Instant without subseconds
java.time.Instant "2024-04-29T20:11:38Z"
java.util.Date "2024-04-29T16:11:38.000-04:00"
Date with nano
java.time.ZonedDateTime "2024-04-29T23:11:38.936155001+03:00[Europe/Moscow]"
Date with milli
java.time.ZonedDateTime "2024-04-29T23:11:38.936+03:00[Europe/Moscow]"
java.util.GregorianCalendar "2024-04-29T16:11:38.936-04:00"
Date without subseconds
java.time.ZonedDateTime "2024-04-29T23:11:38+03:00[Europe/Moscow]"
java.util.GregorianCalendar "2024-04-29T16:11:38.000-04:00"
**** WITH_CONTEXT_TIME_ZONE ****
Instant with nano
java.time.Instant "2024-04-29T20:11:38.936155001Z"
Instant with milli
java.time.Instant "2024-04-29T20:11:38.936Z"
java.util.Date "2024-04-29T16:11:38.936-04:00"
Instant without subseconds
java.time.Instant "2024-04-29T20:11:38Z"
java.util.Date "2024-04-29T16:11:38.000-04:00"
Date with nano
java.time.ZonedDateTime "2024-04-29T16:11:38.936155001-04:00"
Date with milli
java.time.ZonedDateTime "2024-04-29T16:11:38.936-04:00"
java.util.GregorianCalendar "2024-04-29T16:11:38.936-04:00"
Date without subseconds
java.time.ZonedDateTime "2024-04-29T16:11:38-04:00"
java.util.GregorianCalendar "2024-04-29T16:11:38.000-04:00"
**** WITH_CONTEXT_TIME_ZONE_AND_ID ****
Instant with nano
java.time.Instant "2024-04-29T20:11:38.936155001Z"
Instant with milli
java.time.Instant "2024-04-29T20:11:38.936Z"
java.util.Date "2024-04-29T16:11:38.936-04:00"
Instant without subseconds
java.time.Instant "2024-04-29T20:11:38Z"
java.util.Date "2024-04-29T16:11:38.000-04:00"
Date with nano
java.time.ZonedDateTime "2024-04-29T23:11:38.936155001+03:00[Europe/Moscow]"
Date with milli
java.time.ZonedDateTime "2024-04-29T23:11:38.936+03:00[Europe/Moscow]"
java.util.GregorianCalendar "2024-04-29T16:11:38.936-04:00"
Date without subseconds
java.time.ZonedDateTime "2024-04-29T23:11:38+03:00[Europe/Moscow]"
java.util.GregorianCalendar "2024-04-29T16:11:38.000-04:00"
I don’t think the output should depend of the class used, except for the precision. And many are plain wrong, where many features are not really applied. For example with WRITE_DATES_WITH_CONTEXT_TIME_ZONE, even Instant should not be serialized az UTC, but indeed with the context time zone.
The text was updated successfully, but these errors were encountered:
Due to this module being changed over time by bunch of different contributors, without clear owner (after initial version), there are indeed many inconsistencies. But because of (backwards-)compatibility limitations changes need to be done carefully and incrementally.
Given above, this issue is not quite something that can be worked as-is, since its scope is wider than what individual PRs could tackle. It'd be great to create a set of "smaller" issues instead, ones that focused on one specific date/time type or configuration feature.
I’m comparing results of different time object serialization with different settings and the result are very different.
I wrote the following code
The output is
I don’t think the output should depend of the class used, except for the precision. And many are plain wrong, where many features are not really applied. For example with
WRITE_DATES_WITH_CONTEXT_TIME_ZONE
, even Instant should not be serialized az UTC, but indeed with the context time zone.The text was updated successfully, but these errors were encountered: