title: Date timezone with Spring boot and Jackson
body: <p>I'm developing a spring boot application that handles dates. When I submit an Appointment object that has a <code>startDateTime</code> and an <code>endDateTime</code> (Both are of type <code>java.util.Date</code>) I send a format like this:</p>
  
  <pre><code>{
      "lastName": "Jhon",
      "firstName": "Doe",
      "email": "jhon.doe@gmail.com",
      "description": "MyDescription",
      "startDateTime": "2017-10-09T22:43:07.109+0300",
      "endDateTime": "2017-10-09T21:40:07.109+0300",
  }
  </code></pre>
  
  <p>When data is persisted in database it's with the correct timezone, when I try to retrieve my data back, they seem correct when I'm debugging however, once they are serialized by Jackson I have an output with these as value:</p>
  
  <pre><code>"startDateTime": "2017-10-09T19:43:07.109+0000",
  "endDateTime": "2017-10-09T18:40:07.109+0000",
  </code></pre>
  
  <p>How can I configure Jackson to make usage of timezone that comes with the data from my repository?</p>
  
  <p>------Update---------</p>
  
  <p>I tried the answer with <code>OffsetDateTime</code> but the output is quite weird:</p>
  
  <pre><code>"startDateTime": {
          "offset": {
              "totalSeconds": 7200,
              "id": "+02:00",
              "rules": {
                  "fixedOffset": true,
                  "transitionRules": [],
                  "transitions": []
              }
          },
          "month": "OCTOBER",
          "year": 2017,
          "hour": 21,
          "minute": 49,
          "nano": 654000000,
          "second": 15,
          "dayOfMonth": 9,
          "dayOfWeek": "MONDAY",
          "dayOfYear": 282,
          "monthValue": 10
      }
  </code></pre>
  
  <p>I would like to have something like:</p>
  
  <blockquote>
    <p>2017-10-09T22:43:07.109+0300</p>
  </blockquote>