Upon executing the following query in my ClickHouse database:
SELECT formatDateTime(now(), '%Y-%m-%d %H:%M:%S', 'Asia/Tehran');
I received an unexpected result:
2024-03-29 00:34:35
However, the expected output was:
2024-03-28 23:34:35
When setting the timezone in ClickHouse to Asia/Tehran, all datetime values are adjusted to UTC+04:30 instead of the expected UTC+03:30. Could you provide guidance on how to address this issue?
I have upgraded the ClickHouse version from 22.6.1.1985 to 24.3.1.2672, which has resolved the issue. This is due to the fact that prior to the update, ClickHouse (in its 2022 version) adjusted the Asia/Tehran timezone to UTC+4:30 after March 20th to accommodate daylight saving time. However, post-2022, Iran discontinued the observance of daylight saving time. Consequently, following the update, the Asia/Tehran timezone has reverted to UTC+3:30 after March 20th, as it was before the change and it considered by Clickhouse in latest version.