Given input string: 2021-02-01T19:49:04.0513486Z
Jackson will deserialize a ZonedDateTime with the following properties:
offset: "Z" (type ZonedOffset)
zone: "UTC" (type ZoneRegion)
Using the standard call
DateTimeFormatter.ISO_ZONED_DATE_TIME.parse(inputString, ZonedDateTime::from);
produces:
offset: "Z" (type ZonedOffset)
zone: "Z" (type ZonedOffset)
This causes an issue in comparisons because id value "UTC" != id value "Z". This also produces a redundancy in the toString of the ZonedDateTime because it detects that the offset != zone.
toString for Jackson result: 2021-02-01T19:49:04.051348600Z[UTC]
toString for standard result: 2021-02-01T19:49:04.051348600Z
The latter can be consumed without extra processing and is the desired result.
Would it be possible to update the deserializer to behave like the standard call?
Given input string:
2021-02-01T19:49:04.0513486ZJackson will deserialize a ZonedDateTime with the following properties:
offset:"Z"(type ZonedOffset)zone:"UTC"(type ZoneRegion)Using the standard call
produces:
offset:"Z"(type ZonedOffset)zone:"Z"(type ZonedOffset)This causes an issue in comparisons because id value "UTC" != id value "Z". This also produces a redundancy in the toString of the ZonedDateTime because it detects that the offset != zone.
toString for Jackson result:
2021-02-01T19:49:04.051348600Z[UTC]toString for standard result:
2021-02-01T19:49:04.051348600ZThe latter can be consumed without extra processing and is the desired result.
Would it be possible to update the deserializer to behave like the standard call?