The Oracle SESSIONTIMEZONE
function returns the time zone of the current session.
Syntax
The SESSIONTIMEZONE
does not require any argument therefore its syntax is straightforward:
SESSIONTIMEZONE
Code language: SQL (Structured Query Language) (sql)
Return value
The Oracle SESSIONTIMEZONE
function returns either a time zone offset, which is a character type in the format [+|-]TZH:TZM
e.g., -07:00
or a time zone region name e.g., America/Denver
Examples
The following example returns the session time zone:
SELECT
SESSIONTIMEZONE
FROM
dual;
Code language: SQL (Structured Query Language) (sql)
Remarks
The session time zone value can be set using the ALTER SESSION
statement as follows:
ALTER SESSION SET TIME_ZONE = '-07:00';
Code language: SQL (Structured Query Language) (sql)
In this tutorial, you have learned how to use the Oracle SESSIONTIMEZONE
function to get the current session time zone.
Was this tutorial helpful?