Skip to content

Commit 8a5f497

Browse files
committed
YQL-20743: Fix negative UTC offset for %z specifier
commit_hash:ec3e4a5d1fabee8a46027aab303cfa49326a5a81
1 parent e26c354 commit 8a5f497

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

yql/essentials/udfs/common/datetime2/datetime_udf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2918,7 +2918,7 @@ class TFormat: public TBoxedValue {
29182918
return Size;
29192919
}
29202920

2921-
*out++ = shift > 0 ? '+' : '-';
2921+
*out++ = shift >= 0 ? '+' : '-';
29222922
shift = std::abs(shift);
29232923
out += PrintNDigits<2U>::Do(shift / 60U, out);
29242924
out += PrintNDigits<2U>::Do(shift % 60U, out);

yql/essentials/udfs/common/datetime2/test/canondata/test.test_Format_/results.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"% year 1970 monthFullName January monthShortName Jan month 01 day 01 hours 00 minutes 00 seconds 00 tz +0000 tzname GMT text"
2727
]
2828
];
29+
[
30+
[
31+
"% year 1970 monthFullName January monthShortName Jan month 01 day 01 hours 00 minutes 00 seconds 00 tz +0000 tzname UTC text"
32+
]
33+
];
2934
[
3035
[
3136
"% year 2018 monthFullName December monthShortName Dec month 12 day 01 hours 01 minutes 02 seconds 03.456789 tz +0300 tzname Europe/Moscow text"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{"ftztimestamp" = "1970-01-01T00:00:00,GMT"};
2+
{"ftztimestamp" = "1970-01-01T00:00:00,UTC"};
23
{"ftztimestamp" = "2018-12-01T01:02:03.456789,Europe/Moscow"};
34
{"ftztimestamp" = "2011-03-13T02:15:00,America/Los_Angeles"};
45
{"ftztimestamp" = "2011-11-06T01:15:00,America/Los_Angeles"};

0 commit comments

Comments
 (0)