Merge pull request #73496 from ClickHouse/backport/24.10/73091

Backport #73091 to 24.10: Fixing timezone option of formatDateTime
This commit is contained in:
robot-ch-test-poll3 2024-12-18 01:15:07 +01:00 committed by GitHub
commit 018777d1a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 0 deletions

View File

@ -538,6 +538,10 @@ private:
*dest = '-';
offset = -offset;
}
else
{
*dest = '+';
}
writeNumber2(dest + 1, offset / 3600);
writeNumber2(dest + 3, offset % 3600 / 60);

View File

@ -0,0 +1,5 @@
Wednesday-0800
Wednesday-0500
Wednesday+0000
Wednesday+0100
Wednesday+0200

View File

@ -0,0 +1,5 @@
select formatDateTime(toDateTime64('2024-12-11 12:34:56.000', 3, 'US/Pacific'), '%W%z');
select formatDateTime(toDateTime64('2024-12-11 12:34:56.000', 3, 'US/Eastern'), '%W%z');
select formatDateTime(toDateTime64('2024-12-11 12:34:56.000', 3, 'UTC'), '%W%z');
select formatDateTime(toDateTime64('2024-12-11 12:34:56.000', 3, 'Europe/Berlin'), '%W%z');
select formatDateTime(toDateTime64('2024-12-11 12:34:56.000', 3, 'Europe/Athens'), '%W%z');