■ FROM_TZ 함수를 사용해 시간대를 설정하는 방법을 보여준다.
▶ 예제 코드 (SQL)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
SET SERVEROUTPUT ON; DECLARE V_SOURCE_TIME TIMESTAMP := CAST('2019-11-02 21:27:00' AS TIMESTAMP); V_TARGET_TIME1 TIMESTAMP WITH TIME ZONE; V_TARGET_TIME2 TIMESTAMP WITH TIME ZONE; BEGIN V_TARGET_TIME1 := FROM_TZ(V_SOURCE_TIME, '-5:00' ); V_TARGET_TIME2 := FROM_TZ(V_SOURCE_TIME, 'US/EASTERN'); DBMS_OUTPUT.PUT_LINE(V_TARGET_TIME1); DBMS_OUTPUT.PUT_LINE(V_TARGET_TIME2); END; |