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