v.22.4New Feature

Added Date and DateTime Functions in ClickHouse

Added functions makeDate(year, month, day), makeDate32(year, month, day). #35628 (Alexander Gololobov). Implementation of makeDateTime() and makeDateTIme64(). #35934 (Alexander Gololobov).
Introduced functions makeDate(year, month, day), makeDate32(year, month, day), makeDateTime(), and makeDateTime64() for constructing date and datetime values from individual components.

Why it matters

These functions simplify the creation of Date, Date32, DateTime, and DateTime64 values by allowing users to build them directly from year, month, and day parts. This provides a more intuitive and flexible way to generate date and datetime types programmatically within SQL queries, enhancing data manipulation capabilities.

How to use it

Use the functions by passing year, month, and day as integer arguments. For example:

SELECT makeDate(2024, 6, 15) AS date_value,
makeDate32(2024, 6, 15) AS date32_value,
makeDateTime(2024, 6, 15) AS datetime_value;


These functions can be used wherever Date, Date32, DateTime, or DateTime64 values are accepted.