SESSIONTIMEZONE Function in Oracle

In Oracle Database, the SESSIONTIMEZONE function returns the time zone of the current session.

Syntax

The syntax goes like this:

SESSIONTIMEZONE

So, no arguments are required (or accepted), and there are no parentheses.

Example

Here’s an example:

SELECT SESSIONTIMEZONE
FROM DUAL;

Result:

Australia/Brisbane

The return type is a time zone offset (a character type in the format '[+|-]TZH:TZM') or a time zone region name, depending on how the database time zone value was specified in the most recent ALTER SESSION statement.

Calling SESSIONTIMEZONE with Parentheses

As mentioned, the SESSIONTIMEZONE function is called without parentheses.

Here’s what happens when we call it with parentheses:

SELECT SESSIONTIMEZONE()
FROM DUAL;

Result:

Error starting at line : 1 in command -
SELECT SESSIONTIMEZONE()
FROM DUAL
Error at Command Line : 1 Column : 23
Error report -
SQL Error: ORA-00923: FROM keyword not found where expected
00923. 00000 -  "FROM keyword not found where expected"
*Cause:    
*Action:

Get the Database Time Zone

The time zone of the current session may or may not be the same value as the time zone of the database. This depends on your configuration, and they can both be changed independently of each other.

You can use the DBTIMEZONE function to get the time zone of the database.