title: Hibernate 5.3, persist java.time.* truncating to microsecond
body: <p>I've created a Spring Boot 2.x application using Spring JPA and Hibernate 5.3. I'm working with MySql 5.7. As DateTime columns in My DB have a 6 leght precision, I want to truncate the date to microseconds in my application before the value is stored in the DB.</p>
  
  <p>In fact, if I don't do this, when I've a date like <code>2020-01-31T22:59:59.999999999Z</code>, in MySql is persisted as <code>2020-01-31T23:00:00.000000Z</code> and of course I don't want this!</p>
  
  <p>I work with java.time.Instant in my application. I'm looking for a neat way to accomplish this for the entire application.
  I'm conflicted if to use a custom Hibernate type or something else. I'd like some hint to point me in the right direction.</p>