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
The default encoder for ZonedDateTime uses the ISO_ZONED_DATE_TIME formatter, which is only "ISO-like" as it
extends the ISO-8601 extended offset date-time format to add the time-zone. The section in square brackets is not part of the ISO-8601 standard
This results in parsing issues if this encoder is used outside of the JVM, e.g. when using circe to encode ZonedDateTime which is returned in a REST API. E.g. by default JavaScript is not able to decode it:
console.log(Date.parse('2024-03-05T10:04:49.49661+01:00')); // ISO_OFFSET_DATE_TIME, ISO-8601 Europe/Berlin
console.log(Date.parse('2024-03-05T09:01:07.763452Z')); // ISO_OFFSET_DATE_TIME, ISO-8601 UTC
console.log(Date.parse('2024-03-05T08:55:22.97961Z[UTC]')); // ISO_ZONED_DATE_TIME UTC
results in
> 1709629489496
> 1709629267763
> NaN
Given this, I'd argue circe should use ISO_OFFSET_DATE_TIME as the formatter for the default encoder to be ISO conformant and allow compatibility esp. when used outside of the JVM.
This shouldn't have an impact on the decoder as it can handle both formats
The text was updated successfully, but these errors were encountered:
The default encoder for ZonedDateTime uses the ISO_ZONED_DATE_TIME formatter, which is only "ISO-like" as it
This results in parsing issues if this encoder is used outside of the JVM, e.g. when using circe to encode ZonedDateTime which is returned in a REST API. E.g. by default JavaScript is not able to decode it:
results in
Given this, I'd argue circe should use
ISO_OFFSET_DATE_TIME
as the formatter for the default encoder to be ISO conformant and allow compatibility esp. when used outside of the JVM.This shouldn't have an impact on the decoder as it can handle both formats
The text was updated successfully, but these errors were encountered: