Format Functions

This section contains format functions that uses the pattern. The table below contains the supported patterns for the format functions.

FORMAT_DATE( <expr>, format )

Returns the date expression formatted to the specified format.

> select format_date(cast('2023-02-15' as date), 'MM');
02

FORMAT_TIMESTAMP( <expr>, format )

Return the timestamp formatted according to the specified format

> select format_timestamp(current_timestamp(), 'mm');
2023

This section contains format functions that uses the pattern. The table below contains the supported patterns for the format functions.

DATE_FORMAT( <expr>, format )

Return the date and timestamp formatted according to the specified format

> select date_format(cast('2024-08-26 22:38:11' as timestamp), '%m-%d-%Y %H');
08-26-2024 22

Last updated