Oracle DBTIMEZONE Function
Oracle DBTIMEZONE
is a built-in function that returns the value of the database timezone.
Oracle DBTIMEZONE
Syntax
Here is the syntax for the Oracle DBTIMEZONE
function:
DBTIMEZONE(str)
Parameters
The Oracle DBTIMEZONE
function does not require any parameters.
Return Value
The Oracle DBTIMEZONE
function returns the value of the database timezone. The return type is either the timezone offset (in the format '[+|-]TZH:TZM'
) or the timezone region name, depending on how the user specified the database timezone value in the most recent CREATE DATABASE
or ALTER DATABASE
statement.
Oracle DBTIMEZONE
Examples
Here are some examples that demonstrate the usage of the Oracle DBTIMEZONE
function.
Basic Usage
To get the value of the database timezone, use the following statement:
SELECT
DBTIMEZONE
FROM dual;
Output:
DBTIMEZONE
_____________
+00:00
Session Timezone Value
To get the value of the timezone for the current session, use the following statement with SESSIONTIMEZONE
:
SELECT
SESSIONTIMEZONE
FROM dual;
Output:
SESSIONTIMEZONE
__________________
Asia/Shanghai
Conclusion
Oracle DBTIMEZONE
is a built-in function that returns the value of the database timezone.