FROM_TZ function in oracle

By Santhosh N

This explains how to convert the timestamp value to the timestamp with time zone in oracle.

There is function by the name, FROM_TZ  which is used to convert the TIMESTAMP value to the TIMESTAMP WITH TIMEZONE value.

Syntax: FROM_TZ (timestamp, timezone)
Here timestamp is the value that needs to be converted to the timestamp with timezone value, and timezone is the time zone used to convert the specified value to the timezone value specified.

Ex1: SELECT FROM_TZ(TIMESTAMP ‘2010-05-05 10:10:10’, ‘5:00’) from dual;
This returns 05-May-10 10.10.10.000000 AM +05:00

And if the same statement is executed with different timezone then the samething would be

Ex2: SELECT FROM_TZ(TIMESTAMP ‘2010-05-05 10:10:10’, ‘-6:00’) from dual;
This returns 05-May-10 10.10.10.000000 AM -06:00

Related FAQs

This explains how to get the Database Time zone information that is set to the current session.
This explains how to get the current date and time along with the time zone that is set for the session.
This explains how to get the current date along with the time that is set for the session.
This explains how to find the number of months between two dates in oracle
This explains how to add the number of months to a given date in oracle
This explains how to get the last day of the month from the specified date in oracle
FROM_TZ function in oracle  (3388 Views)