What is the use of SESSIONTIMEZONE and DBTIMEZONE in oracle

Viewed 2218

Other than getting the session timezone offset and database timezone offset, is there any other use/role of SESSIONTIMEZONE and DBTIMEZONE in oracle database.

What I want to know is what are the implications of changing SESSIONTIMEZONE and DBTIMEZONE values in terms of inserting/retrieving dates to/from the database.

2 Answers

sysdate and dbtimezone different in Oracle Database explains difference between dbtimezone, system timezone and sessiontimezone.

And here is how to sync sessiontimezone to system timezone if needed:

begin execute immediate 'alter session set time_zone = ''' || to_char(systimestamp, 'TZR') || ''''; end;
Related