mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Fix timezone offset formatting
This commit is contained in:
parent
fe24bd9a7f
commit
cd371110ad
@ -276,10 +276,13 @@ private:
|
||||
{
|
||||
auto offset = TimezoneOffsetImpl::execute(source, timezone);
|
||||
if (offset < 0)
|
||||
{
|
||||
*target = '-';
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
writeNumber2(target + 1, ToHourImpl::execute(offset, timezone));
|
||||
writeNumber2(target + 3, ToSecondImpl::execute(offset, timezone));
|
||||
writeNumber2(target + 1, offset / 3600);
|
||||
writeNumber2(target + 3, offset % 3600 / 60);
|
||||
}
|
||||
|
||||
static void quarter(char * target, Time source, const DateLUTImpl & timezone)
|
||||
|
@ -42,8 +42,9 @@ SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), 'no formatting pattern'
|
||||
SELECT formatDateTime(toDate('2018-01-01'), '%F %T');
|
||||
SELECT
|
||||
formatDateTime(toDateTime('2018-01-01 01:00:00', 'UTC'), '%F %T', 'UTC'),
|
||||
formatDateTime(toDateTime('2018-01-01 01:00:00', 'UTC'), '%F %T', 'Asia/Istanbul')
|
||||
formatDateTime(toDateTime('2018-01-01 01:00:00', 'UTC'), '%F %T', 'Asia/Istanbul');
|
||||
|
||||
SELECT formatDateTime(toDateTime('2020-01-01 01:00:00', 'UTC'), '%z')
|
||||
SELECT formatDateTime(toDateTime('2020-01-01 01:00:00', 'US/Samoa'), '%z')
|
||||
SELECT formatDateTime(toDateTime('2020-01-01 01:00:00', 'Europe/Moscow'), '%z')
|
||||
SELECT formatDateTime(toDateTime('2020-01-01 01:00:00', 'UTC'), '%z');
|
||||
SELECT formatDateTime(toDateTime('2020-01-01 01:00:00', 'US/Samoa'), '%z');
|
||||
SELECT formatDateTime(toDateTime('2020-01-01 01:00:00', 'Europe/Moscow'), '%z');
|
||||
SELECT formatDateTime(toDateTime('1970-01-01 00:00:00', 'IST'), '%z');
|
||||
|
Loading…
Reference in New Issue
Block a user