DATETIME Function [Date and Time]

Converts an expression into a timestamp.

Syntax

DATETIMEexpression )

Parameters

Parameters

Parameter

Description

expression

The expression to be converted. The expression is usually a string. Conversion errors may be reported.

Returns

TIMESTAMP

Example

The following statement returns a timestamp with value 1998-09-09 12:12:12.000:

SELECT DATETIME( '1998-09-09 12:12:12.000' ) FROM iq_dummy

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not supported by Adaptive Server Enterprise or SQL Anywhere.