title: JPA TemporalType.Date giving wrong date
body: <p>I have a class that has a date field representing a "valid from" date for a piece of data. It is defined like this:</p>
  
  <pre><code>@Temporal( TemporalType.DATE )
  private Date validFrom;
  </code></pre>
  
  <p>All seems to be working fine right up the the point where I pull the date from the database and display it. If I select the date 18-Sep-2003 in the front end then save it when I check in the database sure enough that is the date held (database is MySQL 5.5.9 column type is DATE). However when I pull up a list records the date shown is 17 Sep 2003 - one day earlier.</p>
  
  <p>If I choose a date early or late in the year like 26 Mar 2003 or 25 Dec 2003 everything is fine so I guessing this is something to do with daylight saving but where is the error creeping in? Since the database appears to be holding the correct date I'm guessing it must be when JPA is converting back into a java.util.Date - is java.util.Date the best class to use for a date? I've seen a few examples where people use Calendar but that seems pretty heavy weight and I'm not sure how well it will work with a JSF based front end. </p>