This function is used to return the year, month, and day in a time.
Similar function: to_date1. The to_date1 function is used to convert a string in a specified format to a date value. The date format can be specified.
to_date(string timestamp)
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
timestamp |
Yes |
DATE STRING |
Time to be processed The following formats are supported:
|
The return value is of the DATE type, in the yyyy-mm-dd format.
The value 2023-08-16 is returned.
select to_date('2023-08-16 10:54:36');
The value NULL is returned.
select to_date(null);