DATE_FORMAT

Use DATE_FORMAT to convert a datetime to a string. The first parameter is the timestamp expression. The second parameter is the format style, for example, ‘yyyy-MM-dd’.

Syntax

DATE_FORMAT(timestamp_expression, format)