v.22.1Improvement

Date Time Conversion Functions Updated to Handle Pre-1970 Dates Correctly

Now date time conversion functions that generates time before 1970-01-01 00:00:00 will be saturated to zero instead of overflow. #29953 (Amos Bird). It also fixes a bug in index analysis if date truncation function would yield result before the Unix epoch.
Date and time conversion functions in ClickHouse now saturate to zero for timestamps before 1970-01-01 00:00:00 instead of causing overflow. Additionally, a bug related to index analysis with date truncation resulting in pre-Unix epoch dates has been fixed.

Why it matters

This feature prevents incorrect and unstable behavior caused by overflow when converting date and time values prior to the Unix epoch (January 1, 1970). It ensures safer handling of historical dates and improves the reliability of index analysis when working with date truncation functions.

How to use it

No explicit user action is required. The change is applied internally within date time conversion functions and index analysis. Users will automatically benefit from correct behavior when working with dates and times before 1970-01-01 00:00:00.