title: timezone related issue when storing/reading Date using JPA
body: <p>I have a Java EE 5 application (IBM RAD, WebSphere 7.5, Oracle 11).</p>
  
  <p>I'm reading and writing a Date in my app with JPA, looks like this:</p>
  
  <pre><code>@Entity
  @Table="APPOINTMENT"
  public class Appointment implements Serializable {
    /* ... */
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdateTimestamp;
    /* ... */
  }
  </code></pre>
  
  <p>Whenever I update the Appointment, I do a ...</p>
  
  <pre><code>myAppointment.setLastUpdateTimestamp(new Date());
  </code></pre>
  
  <p>... to reflect that the update happened "now".</p>
  
  <p>There are two WebSphere servers, both pointing to the same database.</p>
  
  <p>When my local dev machine's WebSphere stores an update time, it will store "now" as:</p>
  
  <pre><code>March 7, 2013 1:30pm EST
  </code></pre>
  
  <p>When the production server stores an update time, it will store "now" as:</p>
  
  <pre><code>March 7, 2013 6:30pm GMT
  </code></pre>
  
  <p>The problem is the timezones don't appear to be stored as part of the timestamp.  So when I browse to the application on my local (EST) machine, it will display the time as:</p>
  
  <pre><code>March 7, 2013 6:30pm EST 
  </code></pre>
  
  <p>... which is actually 5 hours in the future, if you follow me.</p>
  
  <p>My question is, how do I store the timezone to the database along with the date and time in the Date object?</p>
  
  <p>Any info is useful, thanks!</p>
  
  <p>Rob</p>