1. Derby
  2. DERBY-4582

Timestamps inserted with GMT calendar are 1 hour later when subsequently read with GMT calendar (Server Mode Only).


    • Urgency:
    • Bug behavior facts:
      Embedded/Client difference, Wrong query result


      This issue only appears to happen in Network Server/Client mode. Embedded mode does not have the issue.

      My timezone is American/Chicago. Saving timestamps with values for the 6 hours prior to DST start are being read back in as values 1 hour later than written. (I believe the issue happens on the write because values written in Network Server/Client mode and read in Embedded mode are incorrect, while values written and read in Embedded mode are corect.)

      Values between 3/13/2010 - 20:00 CST and 3/14/2010 - 02:00 CST will return timstamps 1 hour off. The "setTimestamp" method is being passed a GMT calendar with the timestamp:

      I have a complete test class I can attach, but here is a summary:

      private final TimeZone gmtTZ = TimeZone.getTimeZone("GMT");
      private final Calendar gmtCal = Calendar.getInstance(gmtTZ);
      String sql = "INSERT INTO app.dst_test (id, gmt_timestamp, milli_time) VALUES(?,?,?)";
      String sql2 = "SELECT * from app.dst_test where id=?";
      ps.setTimestamp(2, ts, gmtCal);
      Timestamp tsRead = rs.getTimestamp("gmt_timestamp", gmtCal);

      1. derby-4582-10.5.diff
        71 kB
        Lily Wei
      2. derby-4582-6a-javame.diff
        3 kB
        Knut Anders Hatlen
      3. derby-4582-5a-bugfix.diff
        3 kB
        Knut Anders Hatlen
      4. derby-4582-4a-client-receive.diff
        44 kB
        Knut Anders Hatlen
      5. derby-4582-3a-server-send.diff
        9 kB
        Knut Anders Hatlen
      6. derby-4582-2a-server-receive.diff
        9 kB
        Knut Anders Hatlen
      7. derby-4582-1a-client-send.diff
        24 kB
        Knut Anders Hatlen
      8. ASF.LICENSE.NOT.GRANTED--upd-rs-test.diff
        5 kB
        Knut Anders Hatlen
      9. ASF.LICENSE.NOT.GRANTED--junit.diff
        13 kB
        Knut Anders Hatlen
      10. junit.diff
        10 kB
        Knut Anders Hatlen
      11. calendar.diff
        17 kB
        Knut Anders Hatlen
        9 kB
        Keith Kruse

        Issue Links



            • Assignee:
              Knut Anders Hatlen
              Keith Kruse
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: