title: Java, Hibernate, MySQL - store UTC date-time
body: <p>I saw here on SO a few related questions (like <a href="https://stackoverflow.com/questions/9823411/hibernate-force-timestamp-to-persist-load-as-utc">this one</a> and of course, <a href="https://stackoverflow.com/questions/308683/how-can-i-get-the-current-date-and-time-in-utc-or-gmt-in-java/308689#308689">this one</a>)... Essentially, what I want is to store date-time as UTC, and let application user choose the time zone he wants to display date-time in.<br>
  Since it seems that date-time fields are affected by the underlying JDBC driver, I wonder if this is an acceptable way to go about storing UTC date-time:</p>
  
  <ul>
  <li>Set both MySQL and Application server machine to UTC time zone (no need to separate)</li>
  <li>Both MySQL and JVM should pick up underlying system time settings (if not instructed otherwise)</li>
  <li>Use <code>DATETIME</code> table columns on MySQL side</li>
  <li>Use <code>java.util.Date</code> as corresponding mapping on Hibernate side (I guess <code>java.sql.Timestamp</code> could be used too)</li>
  <li>Let the application worry about interpreting date-time fields - i.e. let the user choose preferred time zone</li>
  </ul>
  
  <p>Is this OK?</p>
  
  <p><strong>EDIT</strong><br>
  To clarify - here I meant to refer to timestamps created strictly on the server (e.g.date-time of record creation). So the application server instantiates <code>Date</code> objects (new Date() equals current date-time on the server, and this is really time zone agnostic).<br>
  Now if a client user wants to supply some date for searching/filtering purposes, here is where the transformation from client-local time to UTC should take place, IMHO...</p>