v.22.10Improvement

Improve enable_extended_results_for_datetime_functions to return DateTime64 for specific time functions

Improve option enable_extended_results_for_datetime_functions to return results of type DateTime64 for functions toStartOfDay, toStartOfHour, toStartOfFifteenMinutes, toStartOfTenMinutes, toStartOfFiveMinutes, toStartOfMinute and timeSlot. #41910 (Roman Vasin).
Improved the enable_extended_results_for_datetime_functions option to return DateTime64 type results for several datetime functions including toStartOfDay, toStartOfHour, toStartOfFifteenMinutes, toStartOfTenMinutes, toStartOfFiveMinutes, toStartOfMinute, and timeSlot.

Why it matters

This enhancement provides greater precision in the output of common datetime functions by returning results as DateTime64 instead of DateTime. It addresses the need for sub-second accuracy in time calculations, which is valuable for users requiring high-resolution timestamps in their queries.

How to use it

Enable the feature by setting the enable_extended_results_for_datetime_functions option to 1 (true). Once enabled, the listed datetime functions will produce results in the DateTime64 format, allowing for more precise time computations.