Purpose
FROM_TZ() combines a TIMSTAMP value and a time zone value into a TIMESTAMP WITH TIME ZONE value.
Syntax
FROM_TZ (timestamp_value,time_zone_value)
Parameters
| Parameter | Description |
|---|---|
| timestamp_value | A TIMSTAMP value. |
| time_zone_value | A time zone value. |
Return type
The return type is TIMESTAMP WITH TIME ZONE.
Examples
The following example combines the timestamp value 2021-03-28 08:00:00 and the time zone value +08:00 into a TIMESTAMP WITH TIME ZONE value and returns the value.
obclient> SELECT FROM_TZ(TIMESTAMP '2021-03-28 08:00:00', '+08:00') FROM DUAL;
+-------------------------------------------------+
| FROM_TZ(TIMESTAMP'2021-03-2808:00:00','+08:00') |
+-------------------------------------------------+
| 28-MAR-21 08.00.00.000000000 AM +08:00 |
+-------------------------------------------------+
1 row in set