title: Convert OffsetDateTime to UTC Timestamp
body: <p>I have an <code>java.time.OffsetDateTime</code> which I would like to convert to a <code>java.sql.Timestamp</code>. Since <code>Timestamp</code> doesn't store any offset information, I am going to store all dates/times in the database as UTC.</p>
  
  <p>How do I convert the <code>OffsetDateTime</code> to a <code>Timestamp</code> which is in UTC?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I believe this is the answer but it seems are rather convoluted way to covert to UTC:</p>
  
  <pre><code>OffsetDateTime dateTime = OffsetDateTime.now();
  Timestamp timestamp = Timestamp.valueOf(dateTime.atZoneSameInstant(ZoneId.of("Z")).toLocalDateTime());
  </code></pre>