I use Json.toJson(object) to generate a JSON response for an API. I noticed that all my ZoneDateTimes do not include any timezone information once the JSON is written. A look into the
relevant Play code reveals that the DateTimeFormatter.ISO_LOCAL_DATE is used.
implicit val DefaultZonedDateTimeWrites = temporalWrites[ZonedDateTime, DateTimeFormatter](DateTimeFormatter.ISO_LOCAL_DATE_TIME)
In my opinion this code should use DateTimeFormatter.ISO_OFFSET_DATE_TIME instead.
Is there an elegant way how to include the time zone information? Is it somehow possible to overwrite this built-in formatter?