title: Java jackson how to deserialize into a Date
body: <p>I'm using <code>Jackson</code> to deserialize a date into this attribute:</p>
  
  <pre><code>private Date createDate; 
  </code></pre>
  
  <p>Part of a payload:</p>
  
  <pre><code>"createdDate": "1979-12-05T08:00Z",
  </code></pre>
  
  <p>Getting this error:</p>
  
  <blockquote>
    <p>Can not deserialize value of type java.util.Date from String
    "1979-12-05T08:00Z": not a valid representation (error: Failed to
    parse Date value '1979-12-05T08:00Z': Can not parse date
    "1979-12-05T08:00.000Z": while it seems to fit format
    'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'', parsing fails</p>
  </blockquote>
  
  <p>What I tried so far was to include this dependency:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
    &lt;artifactId&gt;jackson-datatype-jsr310&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>and also:</p>
  
  <pre><code>@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-ddTHH:mmZ")
  private Date createDate; 
  </code></pre>
  
  <p>but it didn't work.</p>