title: Jackson Serialize date as timestamps
body: <p>I have upgraded my spring boot project from 1.5.8 to 2.0.4.  I have noticed that previously all our dates were getting returned as timestamps which was fine.  since the upgrade the dates were coming out as dates, in order to get them back out as timestamps again i added the following to my yml file:</p>
  
  <pre><code>jackson:
    serialization:
      write-dates-as-timestamps: true
  </code></pre>
  
  <p>Now all the dates are getting returned as dates. Can't figure out why.  We have a configuration class which has a jacksonMessageConverter bean defined (required for when converting messages of a rabbitMq), not sure if this is messing up the conversion somehow?</p>
  
  <p>Any help much appreciated</p>
  
  <pre><code>public class ApplicationConfig{
      @Bean
      public AuditorAware&lt;String&gt; auditorProvider() {
          return new AuditorAwareImpl();
      }
  
      @Bean
      public Jackson2JsonMessageConverter jackson2JsonMessageConverter() {
          return new Jackson2JsonMessageConverter();
      }
  
      @Bean
      public ConnectionFactory connectionFactory() {
          CachingConnectionFactory connectionFactory = new 
          CachingConnectionFactory(&lt;host&gt;);
          connectionFactory.setUsername(&lt;user&gt;);
          connectionFactory.setPassword(&lt;pas&gt;);
          connectionFactory.setVirtualHost(&lt;vhost&gt;);
          return connectionFactory;
      }
  
      @Bean
      public RabbitTemplate rabbitTemplate() {
          return new RabbitTemplate(connectionFactory());
      }
  </code></pre>
  
  <p>Update:</p>
  
  <p>I have since added the the following the my config class and now it is working, any ideas why I need this? And why it hasn't just picked up from the spring boot properties?</p>
  
  <pre><code>@Bean
      public Jackson2ObjectMapperBuilder objectMapperBuilder() {
          Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
          builder.featuresToEnable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
          return builder;
      }
  </code></pre>
  
  <p>It doesn't work on date fields where I have defined the format as such, how can I resolve this?:</p>
  
  <pre><code>@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")  
  </code></pre>