I want to configure jackson
to output any date/time values with the following format:
spring.jackson.date-format=yyyy-MM-dd\'T\'HH:mm:ss
Finally it turned out the simples way is to just set the jacksons ObjectMapper
(which uses UTC
by defaut) timezone to the jvm defaults:
@Bean
public Jackson2ObjectMapperBuilderCustomizer init() {
return new Jackson2ObjectMapperBuilderCustomizer() {
@Override
public void customize(Jackson2ObjectMapperBuilder builder) {
builder.timeZone(TimeZone.getDefault());
}
};
}
I'd appreciate if anybody knows how I can achieve the same by just using the spring.jackson.time-zone
application.property.