w3resource

Oracle DBTIMEZONE function

How to get the value of the Database time zone?

The Oracle DBTIMEZONE function retrieves the value of the database time zone. It returns either a time zone offset (in the format '[+|-]TZH ') or a time zone region name, depending on how the database time zone was specified during the most recent CREATE DATABASE or ALTER DATABASE statement.

Uses of Oracle DBTIMEZONE Function
  • Database Configuration: Determine the current time zone setting of the database.

  • Time Zone Management: Assist in managing and adjusting database operations according to the database's time zone.

  • Consistency Checking: Ensure that applications and queries align with the database time zone.

  • Data Integration: Facilitate accurate data exchange between systems with different time zones.

  • Audit and Compliance: Verify the database's time zone setting for compliance with regulations and policies.

Syntax:

DBTIMEZONE

Parameters:

No parameters or arguments.

Return type:

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

Pictorial Presentation

Pictorial Presentation of Oracle DBTIMEZONE function

Example: Oracle DBTIMEZONE function

The following statement assumes that the database time zone is set to UTC time zone:

SQL> SELECT DBTIMEZONE FROM DUAL;

Sample Output:

DBTIMEZONE
-------------
+00:00

Previous: CURRENT_TIMESTAMP
Next: EXTRACT(datetime)



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/oracle/datetime-functions/oracle-dbtimezone-function.php