totn Oracle Functions

Oracle / PLSQL: SESSIONTIMEZONE Function

This Oracle tutorial explains how to use the Oracle/PLSQL SESSIONTIMEZONE function with syntax and examples.

Description

The Oracle/PLSQL SESSIONTIMEZONE function returns the current session's time zone as a time zone offset (in the following format: '[+|-]TZH:TZM') or a time zone region name.

Syntax

The syntax for the SESSIONTIMEZONE function in Oracle/PLSQL is:

SESSIONTIMEZONE

Parameters or Arguments

There are no parameters or arguments for the SESSIONTIMEZONE function.

Returns

The SESSIONTIMEZONE function returns a time zone offset (in the following format: '[+|-]TZH:TZM') or a time zone region name.

Applies To

The SESSIONTIMEZONE function can be used in the following versions of Oracle/PLSQL:

  • Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i

Example

Let's look at some Oracle SESSIONTIMEZONE function examples and explore how to use the SESSIONTIMEZONE function in Oracle/PLSQL.

For example:

SELECT SESSIONTIMEZONE
FROM dual;

The SESSIONTIMEZONE function might return a value like this:

+00:00

or a value such as this:

-07:00

The value returned depends on how the user specified the session time zone value in the most recent ALTER SESSION statement. An example of an ALTER SESSION command is:

ALTER SESSION SET TIME_ZONE = '-7:0';