@ Override public String marshal ( ZonedDateTime zonedDateTime ) { if ( null == zonedDateTime ) { return null ; } return zonedDateTime . withZoneSameInstant ( ZoneOffset . UTC ) . format ( formatter ) ; }
When marshalling the provided zonedDateTime is normalized to UTC so that the output is consistent between dates and time zones .