Oracle ORA_DST_CONVERT() Function

Oracle ORA_DST_CONVERT() is a built-in function that converts a given date-time expression when modifying time zone files and allows you to specify how to handle errors.

This function can only be run when changing the database’s time zone data files and upgrading the time zone data timestamp, and only between the execution of the DBMS_DST.BEGIN_UPGRADE and DBMS_DST.END_UPGRADE programs.

Syntax of Oracle ORA_DST_CONVERT()

Here is the syntax for the Oracle ORA_DST_CONVERT() function:

ORA_DST_CONVERT(datetime_expr [, integer1 [, integer2 ]])

Parameters

datetime_expr

Required. It must parse a TIMESTAMP WITH TIME ZONE value or a VARRAY object containing a TIMESTAMP WITH TIME ZONE value.

integer1

Optional. This parameter specifies how to handle “repeated time” errors. The default value is 0, and this function suppresses errors and returns the source date-time value. Specify 1 to allow the database to return repeated time errors.

integer2

Optional. This parameter specifies how to handle “nonexistent time” errors. The default value is 0, and this function suppresses errors and returns the source date-time value. Specify 1 to allow the database to return nonexistent time errors.

Return Value

If no errors occur, the Oracle ORA_DST_CONVERT() function returns the date-time value corresponding to the given date-time expression when using the new time zone files.

If a “repeated time” error occurs and the second parameter is 1, this function will return the “repeated time” error.

If a “nonexistent time” error occurs and the second parameter is 1, this function will return the “nonexistent time” error.

Conclusion

Oracle ORA_DST_CONVERT() is a built-in function that converts a given date-time expression when modifying time zone files and allows you to specify how to handle errors.