Merge pull request #73091 from ollidraese/issue-72877-formatDateTime

Fixing timezone option of formatDateTime
This commit is contained in:
Alexey Katsman 2024-12-17 20:42:52 +00:00 committed by GitHub
commit 12a8d02798
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');