DBILITY

오라클 SQL 썸머타임(일광절약시간) 테스트 본문

database/oracle

오라클 SQL 썸머타임(일광절약시간) 테스트

DBILITY 2017. 12. 17. 09:21
반응형

여러모로 귀찮다

WITH TBL (SDT,EDT) AS (
	SELECT 
		 TO_TIMESTAMP_TZ('2017-03-12 11:00:00', 'yyyy-mm-dd hh24:mi:ss') + NUMTODSINTERVAL(LEVEL-1 , 'HOUR') SDT
		,TO_TIMESTAMP_TZ('2017-11-05 11:00:00', 'yyyy-mm-dd hh24:mi:ss') + NUMTODSINTERVAL(LEVEL-1 , 'HOUR') EDT 
	FROM 
		DUAL 
	CONNECT BY LEVEL <= 25
)
SELECT 
     SDT
    ,EDT
    ,TO_CHAR(SDT AT TIME ZONE 'Asia/Seoul','YYYY-MM-DD HH24:MI:SS') SDT_SEOUL
    ,TO_CHAR(SDT AT TIME ZONE 'US/Eastern','YYYY-MM-DD HH24:MI:SS') SDT_EASTERN
    ,TO_CHAR(SDT AT TIME ZONE 'America/New_York','YYYY-MM-DD HH24:MI:SS') SDT_NEWYORK
    ,TO_CHAR(EDT AT TIME ZONE 'Asia/Seoul','YYYY-MM-DD HH24:MI:SS') EDT_SEOUL
    ,TO_CHAR(EDT AT TIME ZONE 'US/Eastern','YYYY-MM-DD HH24:MI:SS') EDT_EASTERN
    ,TO_CHAR(EDT AT TIME ZONE 'America/New_York','YYYY-MM-DD HH24:MI:SS') EDT_NEWYORK
    ,TO_CHAR(SYSTIMESTAMP AT TIME ZONE 'Asia/Seoul','YYYY-MM-DD HH24:MI:SS') CURRENT_SEOUL
    ,TO_CHAR(SYSTIMESTAMP AT TIME ZONE 'US/Eastern','YYYY-MM-DD HH24:MI:SS') CURRENT_EASTERN
    ,TO_CHAR(SYSTIMESTAMP AT TIME ZONE 'America/New_York','YYYY-MM-DD HH24:MI:SS') CURRENT_NEWYORK
    ,TO_CHAR(SYSTIMESTAMP AT TIME ZONE 'EST','YYYY-MM-DD HH24:MI:SS') CURRENT_EST
FROM TBL;

SELECT * FROM V$TIMEZONE_NAMES;
반응형

'database > oracle' 카테고리의 다른 글

로또번호생성  (0) 2018.11.05
ROWID 구조  (0) 2018.03.22
oracle 오라클 테스트 데이터 생성 예제  (0) 2017.09.30
계정생성..  (0) 2017.08.29
oracle CTAS NOLOGGING  (0) 2017.07.04
Comments