v.1.1.54337New Feature
New Date Functions and Case Sensitivity Update
Added the functionstoTimeZone,timeDiff,toQuarter,toRelativeQuarterNum. ThetoRelativeHour/Minute/Secondfunctions can take a value of typeDateas an argument. Thenowfunction name is case-sensitive.
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()