User Tools

Site Tools

A PCRE internal error occured. This might be caused by a faulty plugin

Sidebar

**HPL/SQL is included to Apache Hive since version 2.0** * [[home|Home]]\\ * [[why|Why HPL/SQL]]\\ * [[features|Key Features]]\\ * [[start|Get Started]]\\ * [[doc|HPL/SQL Reference]]\\ * [[download|Download]]\\ * [[new|What's New]]\\ * [[about|About]]

to-timestamp

====== TO_TIMESTAMP Function - PL/HQL Reference====== TO_TIMESTAMP function converts a string to TIMESTAMP data type using the specified format. **Syntax**: <code language="sql"> TO_TIMESTAMP(string_expression, format_expression); </code> **Return Data Type:** TIMESTAMP **Format Elements**: | YYYY | 4-digit year | | MM | Month (1-12) | | DD | Day (1-31) | | HH24 | Hour of the day (0-23) | | MI | Minute (0-59) | | SS | Second (0-59) | **Examples:** <code language="sql"> TO_TIMESTAMP('2015-04-02', 'YYYY-MM-DD'); TO_TIMESTAMP('04/02/2015', 'mm/dd/yyyy'); TO_TIMESTAMP('2015-04-02 13:51:31', 'YYYY-MM-DD HH24:MI:SS'); </code> **Compatibility**: Oracle, IBM DB2, Teradata **Version**: PL/HQL 0.3.1 See also: * [[date-literal|DATE Literal]] * [[timestamp-literal|TIMESTAMP Literal]] * [[date|DATE Function]] * [[timestamp-iso|TIMESTAMP_ISO]] function