title: Deserializing LocalDateTime with Jackson JSR310 module
body: <p>I'm using the library described <a href="https://github.com/FasterXML/jackson-datatype-jsr310" rel="noreferrer">the Jackson Datatype JSR310 page</a> but I'm still having difficulty getting it to work.</p>
  
  <p>I have configured the following bean:</p>
  
  <pre><code>@Bean
  @Primary
  public ObjectMapper objectMapper() {
      ObjectMapper mapper = new ObjectMapper();
      mapper.registerModule(new JSR310Module());
      return mapper;
  }
  </code></pre>
  
  <p>When I call my REST API the date format output is <code>yyyy-MM-dd'T'HH:ss.SSSSSS</code>, e.g. <code>2015-04-11T00:10:38.905847</code>. This gets handled by my AngularJS code just fine.</p>
  
  <p>When I want to submit something to the REST API the date is posted as <code>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</code>, e.g. <code>2015-04-09T08:30:00.000Z</code></p>
  
  <p>Jackson keeps complaining about the 'Z' at the end. If I look at the <code>LocalDateTimeDeserializer</code> in the documentation it uses the <code>DateTimeFormatter.ISO_LOCAL_DATE_TIME</code> which boils to <code>ISO_LOCAL_DATE'T'ISO_LOCAL_TIME</code> and it mentions it has no override zone.</p>
  
  <p>So I figured I should set the <code>DateFormat</code> on the <code>ObjectMapper</code> I'm creating:</p>
  
  <pre><code>@Bean
  @Primary
  public ObjectMapper objectMapper() {
      ObjectMapper mapper = new ObjectMapper();
      mapper.registerModule(new JSR310Module());
      mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
      return mapper;
  }
  </code></pre>
  
  <p>But this does nothing. I changed it to something simple like <code>yyyy-MM-dd</code> but the serialized date remained in the previous format and the deserialization isn't affected either.</p>
  
  <p>What am I doing wrong here to get this to work? The date format in my JavaScript code is, as far as I know the ISO 8601 format...</p>