The TO_TIMESTAMP_TZ function converts a string to a value that is of the TIMESTAMP WITH TIME ZONE data type and contains the time zone information.
Syntax
TO_TIMESTAMP_TZ (char,[fmt],['nlsparam'])
Parameters
| Parameter | Description |
|---|---|
| char | Specifies the string of the CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type. |
| fmt | Specifies the output format. |
| nlsparam | Specifies the language that is used for the returned month and day. |
Return type
TIMESTAMP WITH TIME ZONE data type
Examples
Execute the following statement:
SELECT TO_TIMESTAMP_TZ ('10-Sep-02 14:10:10.123000', 'DD-Mon-RR HH24:MI:SS.FF') FROM DUAL;
The following query result is returned:
+----------------------------------------------------------------------+
| TO_TIMESTAMP_TZ('10-SEP-0214:10:10.123000','DD-MON-RRHH24:MI:SS.FF') |
+----------------------------------------------------------------------+
| 2002-09-10 14:10:10.123000000 +08:00 |
+----------------------------------------------------------------------+