0 Replies Latest reply on Jun 19, 2005 8:16 PM by John Holmes

    Storing DATETIME with CMP changes time & date

    John Holmes Newbie


      I am trying to store a DATETIME field using EJB CMP in JBoss 4.0.2, XDoclet, and MySQL 4. Definition is very straightforward:

      * @return Returns the m_bidDate.
      * @ejb.interface-method view-type = "both"
      * @ejb.persistence column-name = "bid_date"
      public abstract Date getBidDate();

      * @ejb.interface-method view-type = "both"
      public abstract void setBidDate(Date date);

      The issue I have is that I when I set a date and then read it out again, it moves back 1 hour:

      17:06:58,343 INFO [STDOUT] Bid date out:Sat Jul 10 00:00:00 PDT 2004
      17:07:01,468 INFO [STDOUT] Bid date in:Fri Jul 09 23:00:00 PDT 2004

      I checked the query log for my MySQL DB, and it already arrives there wrong:
      UPDATE project SET bid_date='2004-07-09 23:00:00' WHERE plan_key='9779'

      Where is this coming from? I have the timezone of all my machines set to PST. Could this be a daylight savings setting?