I'm using Spring Boot with the following ObjectMapper:
@Bean
public ObjectMapper objectMapper()
{
final ObjectMapper mapper = new ObjectMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true)); // Makes no difference to output
mapper.findAndRegisterModules();
return mapper;
}
When OffsetDateTimes are serialized and returned in responses, they have a format like this:
"2020-02-28T12:28:29.01Z"
"2020-02-28T12:36:21.885Z"
I would have expected the timezone information at the end to look like this instead:
"2020-02-28T10:41:25.287+00:00"
Is there something I'm missing or doing wrong here, or anyway I can get the timezone information serialized as the +00:00 format instead of 885Z format?
Many thanks!