Timestamp issue?
Posted: Fri 21 May 2010 02:46
It appears that there's a problem if a session's time_zone is changed in a script. Here's an example:
Will give the data:
The second column is the ODAC version while the third column is the Oracle version of the data. It looks like ODAC is ignoring the session timezone information when converting the timestamp for display. Is there anything that can be done to fix that?
Thanks for any help.
-Mark
Code: Select all
-- Note: actual timezone is -4:00.
ALTER SESSION SET TIME_ZONE='-07:00';
DROP TABLE table_tsltz;
CREATE TABLE table_tsltz (c_id NUMBER, c_tsltz TIMESTAMP WITH LOCAL TIME ZONE);
INSERT INTO table_tsltz VALUES(1, '01-JAN-2003 2:00:00');
INSERT INTO table_tsltz VALUES(2, TIMESTAMP '2003-01-01 2:00:00');
INSERT INTO table_tsltz VALUES(3, TIMESTAMP '2003-01-01 2:00:00 -08:00');
COMMIT;
SELECT c_id, c_tsltz, TO_CHAR(c_tsltz) FROM table_tsltz;
Code: Select all
C_ID C_TSLTZ TO_CHAR(C_TSLTZ)
---- ---------------------------- ----------------------------
1 01/01/2003 5:00:00.000000 AM 01-JAN-03 02.00.00.000000 AM
2 01/01/2003 5:00:00.000000 AM 01-JAN-03 02.00.00.000000 AM
3 01/01/2003 6:00:00.000000 AM 01-JAN-03 03.00.00.000000 AM
Thanks for any help.
-Mark