Skip to content
Advertisement

Tag: jackson-modules

Jackson , java.time , ISO 8601 , serialize without milliseconds

I’m using Jackson 2.8 and need to communicate with an API that doesn’t allow milliseconds within ISO 8601 timestamps. The expected format is this: “2016-12-24T00:00:00Z” I’m using Jackson’s JavaTimeModule with WRITE_DATES_AS_TIMESTAMPS set to false. But this will print milliseconds. So I tried to use objectMapper.setDateFormat which didn’t change anything. My current workaround is this: I’m overriding the default serializer for

Advertisement