title: How to save a date in a specific format with timezone in hibernate
body: <p>Previously, I used to write to the database.</p>
  <pre><code>insert into test_table 
      (id, event_date, insert_date) 
  values 
      (:id, 
      to_timestamp(:event_date, &quot;YYYY-MM-DD HH24:MI:SS.FF3TZH:TZM&quot;), 
      to_timestamp(:insert_date, &quot;YYYY-MM-DD HH24:MI:SS.FF3TZH:TZM&quot;) AT TIME ZONE 'utc')
  </code></pre>
  <p>Now I'm trying to rewrite the insertion into the database using hibernate. I wrote Entity, but I don't know how to specify the correct date format <code>YYYY-MM-DD HH24:MI:SS.FF3TZH:TZM</code> and <code>&quot;YYYY-MM-DD HH24:MI:SS.FF3TZH:TZM&quot;</code> in <code>UTC</code></p>
  <pre><code>@Entity
  @Table(name = &quot;test_table&quot;)
  public class TestTable {
      @Id
      private Long id;
  
      //?
      private LocalDateTime eventDate;
  
      //?
      private LocalDateTime insertDate;
  }
  </code></pre>
  <p>Also, I'm not sure I've chosen the right type <code>LocalDateTime</code>. The date comes to me as a string.</p>
  <p>How do I save the date in the correct format? I use Postgresql</p>