如果是日期加减比较容易 直接这样写就可以了 select (sysdate + 2) from dual ; 月份也很容易: add_months ('01-Aug-03', 3) would return '01-Nov-03' 如果是时区 add_hours 不能用,date + date 也是非法的...wk
SELECT newtime(TEST_TIME,'CDT','PDT') FROM TESTDATA
actually it is the function NEW_TIME(RIGHT DATE, MIDDLE VARCHAR2, LEFT VARCHAR2) return DATE;
Description: This function returns new time in a time specified time zone. This new time is equivalent to a input time in a specified time zone. The function parameters are:RIGHT An input DATE variable. MIDDLE The TIME ZONE of the input DATE variable RIGHT. LEFT The TIME ZONE of the returned DATE value.Examples:(1) DAY := NEW_TIME(SYSDATE, ‘PST’, ‘GMT’); -- This returns the current Pacific Standard Time to -- Greenwich Mean Time.
月份也很容易: add_months ('01-Aug-03', 3) would return '01-Nov-03' 如果是时区 add_hours 不能用,date + date 也是非法的...wk
NEW_TIME(RIGHT DATE, MIDDLE VARCHAR2, LEFT VARCHAR2) return DATE;
Description: This function returns new time in a time specified time zone. This new time is equivalent to a input time in a specified time zone. The function parameters are:RIGHT An input DATE variable.
MIDDLE The TIME ZONE of the input DATE variable RIGHT.
LEFT The TIME ZONE of the returned DATE value.Examples:(1) DAY := NEW_TIME(SYSDATE, ‘PST’, ‘GMT’);
-- This returns the current Pacific Standard Time to
-- Greenwich Mean Time.