This Oracle tutorial explains how to use the Oracle/PLSQL FROM_TZ function with syntax and examples.
The Oracle/PLSQL FROM_TZ function converts a TIMESTAMP value (given a TIME ZONE) to a TIMESTAMP WITH TIME ZONE value.
The syntax for the FROM_TZ function in Oracle/PLSQL is:
FROM_TZ( timestamp_value, time_zone_value )
The value to convert to a TIMESTAMP WITH TIME ZONE value.
The time zone used to convert timestamp_value to a TIMESTAMP WITH TIME ZONE value.
The FROM_TZ function returns a TIMESTAMP WITH TIME ZONE value.
The FROM_TZ function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle FROM_TZ function examples and explore how to use the FROM_TZ function in Oracle/PLSQL.
For example:
If you executed the following SQL statement:
select FROM_TZ(TIMESTAMP '2005-09-11 01:50:42', '5:00')
from dual;
You would now get the following result:
11-Sep-05 01.50.42.000000 AM +05:00
If you executed the same SQL statement, but set the time zone to '-7:00' as follows:
select FROM_TZ(TIMESTAMP '2005-09-11 01:50:42', '-7:00')
from dual;
You would now get the following result:
11-Sep-05 01.50.42.000000 AM -07:00