All Products
Search
Document Center

TO_TIMESTAMP

Last Updated: Jun 18, 2021

The TO_TIMESTAMP function converts a string to the TIMESTAMP data type.

Syntax

TO_TIMESTAMP (char,[fmt],['nlsparam'])

Parameters

Parameter

Description

char

The string of the CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type.

fmt

Specifies the format of the return value.

nlsparam

Controls the language of the returned month and day.

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                                     |
+-------------------------------------------------------------------+