Syntax
Parameters
date: the date you want to convert. It must be a valid date or date expression.format: the format of the date and time to be returned. For information about the available formats, see Joda-Time format.
Return value
Currently, the return value is a string that contains a maximum of 128 bytes in length. If the length of the string converted from the specified date exceeds 128 bytes,NULL is returned.
Examples
Example 1: Convert the date2020-06-25 15:58:51 into a string in yyyy-MM-dd format.
2020-06-25 15:58:51 into a string in yyyy-MM-dd HH:mm:ss format.
2020-06-25 15:58:51 into a string in MM dd ee EE format.
2020-06-25 15:58:51 into a string in MMM dd ee EEE format.
2020-06-25 15:58:51 into a string in MMMM dd ee EEEE format.
2023-06-25 12:00:00 into a string in KK:mm:ss a format.
2023-06-25 12:00:00 into a string in hh:mm:ss a format.
2023-06-25 00:00:00 into a string in yyyyMMdd ''starrocks'' format.