v.1.1.54337New Feature

New Date Functions and Case Sensitivity Update

Added the functions toTimeZone, timeDiff, toQuarter, toRelativeQuarterNum. The toRelativeHour/Minute/Second functions can take a value of type Date as an argument. The now function name is case-sensitive.
Introduces new date and time functions including toTimeZone, timeDiff, toQuarter, and toRelativeQuarterNum, expands toRelativeHour/Minute/Second to accept Date arguments, and enforces case sensitivity for the now function name.

Why it matters

This feature enhances date and time manipulation capabilities in ClickHouse, allowing more precise timezone conversions, time difference calculations, and quarter-based operations. It also clarifies function usage by enforcing case sensitivity for the now function, preventing ambiguity and potential errors.

How to use it

Use the new functions as follows:

SELECT toTimeZone(<date_or_datetime>, <timezone>)
SELECT timeDiff(<unit>, <start_date>, <end_date>)
SELECT toQuarter(<date_or_datetime>)
SELECT toRelativeQuarterNum(<date_or_datetime>, <offset>)
SELECT toRelativeHour(<date>)
SELECT toRelativeMinute(<date>)
SELECT toRelativeSecond(<date>)
-- Note that the function name now must be used with exact case sensitivity
SELECT now()