Wednesday, November 4, 2020

Oracle display current time to a different timezone

 SELECT username, TO_CHAR(
         FROM_TZ( CAST( created AS TIMESTAMP ), 'AMERICA/PHOENIX' )
           AT TIME ZONE 'ASIA/MANILA',
         'YYYY-MM-DD HH24:MI:SS TZH:TZM TZR'
       ) AS MANILA_time, created
FROM   dba_users where username like 'RO_%' or username='ORA_AUDIT' order by 1;


SELECT  TO_CHAR(
         FROM_TZ( CAST( sysdate AS TIMESTAMP ), 'AMERICA/PHOENIX' )
           AT TIME ZONE 'ASIA/MANILA',
         'YYYY-MM-DD HH24:MI:SS TZH:TZM TZR'
       ) AS manila_time, sysdate
FROM   dual;

No comments:

Post a Comment