Skip to main content

DATE_FORMAT

Introduced: v1.1.39

Converts a date value to a specific string format. To customize the format of date and time in Databend, you can utilize specifiers. These specifiers allow you to define the desired format for date and time values. For a comprehensive list of supported specifiers, see Formatting Date and Time.

Syntax

DATE_FORMAT(<date>, <format>)

Return Type

String.

Examples

SELECT DATE_FORMAT('2022-12-25', 'Month/Day/Year: %m/%d/%Y')

+-------------------------------------------------------+
| date_format('2022-12-25', 'month/day/year: %m/%d/%y') |
+-------------------------------------------------------+
| Month/Day/Year: 12/25/2022 |
+-------------------------------------------------------+