TZ_OFFSET

2023-10-31 11:17:12  Updated

Purpose

TZ_OFFSET() returns the time zone offset of SESSIONTIMEZONE or DBTIMEZONE.

Note

A time zone offset is the difference (in hour and minute) from the Greenwich Mean Time (GMT).

Syntax

TZ_OFFSET({ SESSIONTIMEZONE | DBTIMEZONE})

Parameters

Parameter Description
SESSIONTIMEZONE The time zone of the current session.
DBTIMEZONE The database time zone.

Return type

The return type is VARCHAR2.

Examples

The following example returns the time zone offsets of SESSIONTIMEZONE and DBTIMEZONE.

obclient> SELECT TZ_OFFSET(SESSIONTIMEZONE),TZ_OFFSET(DBTIMEZONE) FROM DUAL;
+----------------------------+-----------------------+
| TZ_OFFSET(SESSIONTIMEZONE) | TZ_OFFSET(DBTIMEZONE) |
+----------------------------+-----------------------+
| +08:00                     | +00:00                |
+----------------------------+-----------------------+
1 row in set

Contact Us