v.23.1New Feature

Implemented Fractional Second Formatter for formatDateTime

Implemented a fractional second formatter (%f) for formatDateTime. #44060 (ltrk2). #44497 (Alexander Gololobov).
Implemented a fractional second formatter (%f) for the formatDateTime function in ClickHouse.

Why it matters

This feature enables users to format datetime values with fractional seconds, improving precision and allowing better representation of sub-second time components in query results.

How to use it

Use the formatDateTime function with the %f specifier in the format string to include fractional seconds. For example:

SELECT formatDateTime(now(), '%Y-%m-%d %H:%M:%S.%f')

This will return the current datetime with fractional seconds included.