TO_DATE

Converts a string value to a DATE type.

Behavior Type

Stable

Syntax

TO_DATE ( expression , pattern )

Parameters

expression Specifies the string value to convert, either CHAR or VARCHAR.
pattern

A CHAR or VARCHAR that specifies an output pattern string. See:

Input Value Considerations

TO_DATE requires a CHAR or VARCHAR expression. For other input types, use TO_CHAR to perform an explicit cast to a CHAR or VARCHAR before using this function.

Notes

Examples

=> SELECT TO_DATE('13 Feb 2000', 'DD Mon YYYY');
  to_date   
------------
 2000-02-13
(1 row)