title: OffsetDateTime persisted by JPA differs by 2 hours
body: <p>I have a JPA entity class with an <code>OffsetDateTime</code> field like this:</p>
  
  <pre><code>@Entity
  class MyEntity(clock: Clock) {
      // ...
      val created: OffsetDateTime = OffsetDateTime.now(clock)
  }
  </code></pre>
  
  <p>In a repository test I check that the date is corretly mapped:</p>
  
  <pre><code>assertThat(entity.created).isEqualTo(defaultDateTime)
  </code></pre>
  
  <p>If I compare the underlying <code>Instant</code> (and not also the offset) with <code>OffsetDateTime#isEqual</code> it works:</p>
  
  <pre><code>assertThat(entity.created.isEqual(defaultDateTime)).isTrue()
  </code></pre>
  
  <p><code>defaultDateTime</code> and the <code>clock</code> are created with this code:</p>
  
  <pre><code>val defaultDateTime: OffsetDateTime =
      OffsetDateTime.of(2019, 6, 15, 11, 48, 59, 0, ZoneOffset.UTC)
  
  fun createTestClock(dateTime: OffsetDateTime = defaultDateTime) = 
      Clock.fixed(dateTime.toInstant(), ZoneId.of("UTC"))
  </code></pre>
  
  <p>But if I run my test, the time differs by exactly 2 hours (what is the actual offset in my region, central europe). The PostgreSQL database returns <code>GMT</code> if I query the timezone with <code>show timezone;</code>.</p>
  
  <p>The column data type is:</p>
  
  <pre><code>timestamp with time zone not null
  </code></pre>
  
  <p>Setting the respective Hibernate property doesn't help:</p>
  
  <pre><code>spring.jpa.properties.hibernate.jdbc.time_zone=UTC
  </code></pre>
  
  <p>What is wrong?</p>