v.20.5New Feature
New function toStartOfSecond for DateTime64 in ClickHouse
New function function toStartOfSecond(DateTime64) -> DateTime64 that nullifies sub-second part of DateTime64 value. #10722 (Vasily Nemkov).
Why it matters
This feature addresses the need to normalizeDateTime64 values by removing fractional seconds, which is useful for grouping, filtering, or comparing timestamps at the second level accuracy without sub-second details.How to use it
Use the function in your queries by passing aDateTime64 column or value to toStartOfSecond. For example:SELECT toStartOfSecond(your_datetime64_column) FROM your_table;