v.20.7Improvement

Fix DateTime Parsing to Avoid Negative Unix Timestamps in Timezones

Avoid overflow in parsing of DateTime values that will lead to negative unix timestamp in their timezone (for example, 1970-01-01 00:00:00 in Moscow). Saturate to zero instead. This fixes #3470. This fixes #4172. #12443 (alexey-milovidov).
Prevent overflow when parsing DateTime values that result in negative Unix timestamps in certain timezones by saturating these values to zero.

Why it matters

This feature addresses an overflow issue where parsing DateTime values, like 1970-01-01 00:00:00 in the Moscow timezone, could lead to negative Unix timestamps. By saturating these values to zero instead of allowing overflow, it ensures more accurate and stable timestamp processing, preventing potential errors and data inconsistencies.

How to use it

This behavior is applied automatically in ClickHouse when parsing DateTime values, requiring no additional user configuration or syntax changes.