v.21.2New Features

Function formatDateTime Enhances Date Formatting to Include Quarter Support

Function formatDateTime support the %Q modification to format date to quarter. #19224 (Jianmei Zhang).
The formatDateTime function now supports the %Q format specifier to output the quarter of the year from a date.

Why it matters

This feature enables users to easily extract and format the quarter of a given date directly within the formatDateTime function, simplifying date-time formatting tasks that involve quarters, and enhancing date manipulation capabilities in ClickHouse.

How to use it

Use the formatDateTime function with the %Q format specifier in the format string to get the quarter of the year. For example:

SELECT formatDateTime(your_date_column, '%Q') FROM your_table;