TO_TIMESTAMP()

Scalar. Converts a given value to a Timestamp.

Syntax

TO_TIMESTAMP( value ) TO_TIMESTAMP( value, format )
Parameters

value

The value to convert. Numeric values represent the number of microseconds from the epoch (midnight, January 1, 1970 UTC).

format

A format string. Only valid if value is a String. See Timestamp Format Codes for more information.

Data Types

Return

value

format

Timestamp

Long

N/A

Float

Timestamp

String

String

Example

The following example reads a string in the specified format and converts it to a Timestamp:

INSERT INTO OutStream
SELECT TO_TIMESTAMP(Log.Time, 'DY MON DD HH24:MI:SS YYYY') 
   AS Time
FROM Log;