Link Search Menu Expand Document

TO_DATE

Converts a string to DATE type using optional formatting.

Syntax

TO_DATE(<string> [,format])
Parameter Description
<string> The string to convert to a date.
format An optional string literal that defines the format of the input string, in terms of its date parts.

Example

SELECT
	TO_DATE('2020-05-31', 'YYYY-MM-DD') AS res;

Returns: 2020-05-31