![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hello, I have a problem with a timestamp with timezone in an object type. What I do is. Create a type like this: CREATE OR REPLACE TYPE OBJ_TIMESTAMP AS OBJECT ( TEST_TS TIMESTAMP(3) WITH LOCAL TIME ZONE ); Create a function returning such an object: CREATE OR REPLACE FUNCTION OBJ_CURRENT_TIME RETURN OBJ_TIMESTAMP IS v_return OBJ_TIMESTAMP; BEGIN v_return := OBJ_TIMESTAMP(CURRENT_TIMESTAMP); RETURN v_return; END OBJ_CURRENT_TIME; If my session timezone is: SELECT sessiontimezone FROM DUAL; SESSIONTIMEZONE --------------- +02:00 Everything works just fine like expected: SELECT OBJ_CURRENT_TIME().TEST_TS from dual; OBJ_CURRENT_TIME().TEST_TS ------------------------------- 13-SEP-06 01.53.30.693845 PM But if a change to CET: ALTER SESSION SET TIME_ZONE = 'CET'; SELECT sessiontimezone FROM DUAL; SESSIONTIMEZONE ---------------- CET and execute the same again: SELECT OBJ_CURRENT_TIME().TEST_TS from dual; OBJ_CURRENT_TIME().TEST_TS --------------------------- 11--48 05.02.01.086455 PM I'm facing this problem in 10.1.0.4 and 10.2.0.1 Am I doing something wrong with the object or is it a bug? Thanks Björn |
While session time zone is not![]() |
| Thread Tools | |
| Display Modes | |
| |