title: How to format the json date format using spring boot
body: <p>I am working on spring boot and gradle for creating a rest service. Now I need to format the json date in the form of "yyyy-MM-dd", i.e, the format should be dateOfBirth: "16-03-2015", but I am getting "dateOfBirth: -751181400000". I added the below piece of code in my Apllication.java class, but still not able to get the desired output.</p>
  
  <pre><code>@Bean
  @ConditionalOnClass({ ObjectMapper.class, Jackson2ObjectMapperBuilder.class })
  public Jackson2ObjectMapperBuilder jacksonBuilder()
  { 
      Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); 
      builder.indentOutput(true).dateFormat(new SimpleDateFormat("yyyy-MM-dd")); 
      return builder; 
  }
  </code></pre>
  
  <p>And Application.java:</p>
  
  <pre><code>@Configuration
  @Import(SubjectServiceConfig.class)
  @EnableAutoConfiguration
  @EnableEurekaClient
  @ComponentScan({"com.billing"})
  @EnableWebMvc
  @EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
  public class Application {
  public static void main(String[] args) {
      SpringApplication.run(Application.class, args);
  }
  }
  </code></pre>
  
  <p>Kindly help me out in resolving this issue.</p>