Posted By

bbrumm on 02/28/17


Tagged

sql Oracle


Versions (?)

Oracle TZ_OFFSET Function


 / Published in: SQL
 

URL: http://www.databasestar.com/oracle-tz_offset/

A few examples of the TZ_OFFSET function.

  1. --Example 1
  2. SELECT TZ_OFFSET('US/Eastern') AS tz_test
  3. FROM dual;
  4.  
  5. --Example 2
  6. SELECT TZ_OFFSET('-02:00') AS tz_test
  7. FROM dual;
  8.  
  9. --Example 3
  10. SELECT TZ_OFFSET(SESSIONTIMEZONE) AS tz_test
  11. FROM dual;
  12.  
  13. --Example 4
  14. SELECT TZ_OFFSET(DBTIMEZONE) AS tz_test
  15. FROM dual;
  16.  
  17. --Example 5
  18. SELECT
  19. TZ_OFFSET(SESSIONTIMEZONE) AS tz_test,
  20. SIGN(TO_NUMBER(SUBSTR(TZ_OFFSET(SESSIONTIMEZONE), 1, 3))) * (
  21. TO_NUMBER(SUBSTR(TZ_OFFSET(SESSIONTIMEZONE), 2, 2)) +
  22. TO_NUMBER(SUBSTR(TZ_OFFSET(SESSIONTIMEZONE), 5, 2)) / 60
  23. ) AS tz_offset_num
  24. FROM dual;
  25.  
  26.  
  27.  
  28. SELECT * FROM V$TIMEZONE_NAMES;

Report this snippet  

You need to login to post a comment.