title: Spring Boot - return dates (not as timestamps)
body: <p>I'm using Spring-Boot 1.2.2 with this code:</p>
  
  <pre><code>@RequestMapping(value = "/dates", method = RequestMethod.GET)
  public Date getDates() {
      return new Date();
  }
  </code></pre>
  
  <p>which returns this response:</p>
  
  <pre><code>1433241315047
  </code></pre>
  
  <p>How can I make it return <code>"Sun May 31 16:26:43 IDT 2015"</code> ?
  I found some examples on Google like <code>mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false)</code> but can't figure out where should I write this...</p>
  
  <p><strong>UPDATE:</strong><br>
  I added 2 dependencies to pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;joda-time&lt;/groupId&gt;
          &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
          &lt;version&gt;2.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-datatype-joda&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>and added <code>spring.jackson.date-format=yyyy-MM-dd</code> to <code>application.properties</code>
  and still getting timestamps, so I started to eliminate all unnecessary code and found that removing the <code>@Configuration</code> annotation from my <code>WebConfiguration.java</code> solve the this issue:</p>
  
  <pre><code>import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.http.converter.HttpMessageConverter;
  import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
  import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  
  import java.util.List;
  
  @Configuration
  @EnableWebMvc
  @ComponentScan
  public class WebConfiguration extends WebMvcConfigurerAdapter {
  
      @Override
      public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt;     httpMessageConverters) {
  
          httpMessageConverters.add(new     MappingJackson2HttpMessageConverter());
      }
  }
  </code></pre>
  
  <p>I guess this class somehow override date-format setting... So can I specify the date-format here?</p>