Deserialize Date object with Jackson in Spring boot

the only global setting that worked for me is ObjectMapper

   @Bean
        @Primary
        public ObjectMapper objectMapper()
        {
            final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
            final ObjectMapper mapper = new ObjectMapper();
            mapper.setDateFormat(sdf);
            mapper.enable(SerializationFeature.INDENT_OUTPUT);
            return mapper;
        }

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top