to-timestamp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

to-timestamp [2015/09/23 20:27] (current)
Line 1: Line 1:
 +====== 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