0 Replies Latest reply on Jan 23, 2015 9:52 AM by 908090

    TIMESTAMP WITH TIME ZONE getting shifted one hour during conversion


      I am using Oracle and the version of JDBC.

      I have a specific value stored in a TIMESTAMP WITH TIMEZONE column. The value in the DB is 25-DEC-11 PM -06:00.

      From the ResultSet that returns this value, I perform the following:

      TIMESTAMPTZ tsTZ = (TIMESTAMPTZ)resultSet.getObject(columnNumber);

      TimeZone zone = extractTimeZone(tsTZ.toBytes()); // This returns the correct GMT-06:00 time zone

      Timestamp stamp = tsTZ.timestampValue(connection);

      Calendar cal = Calendar.getInstance(zone);

      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mma Z");

      The result is "2011-12-25 07:18 PM -0600"

      For some unknown reason, the time is being shifted by one hour.

      Can anyone shed a light on this?

      Edited by: 905087 on Dec 29, 2011 11:47 AM