aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordakovalkov <dakovalkov@yandex-team.com>2023-02-11 01:11:48 +0300
committerdakovalkov <dakovalkov@yandex-team.com>2023-02-11 01:11:48 +0300
commit17dbb95cd16a40cae47b42c20177d002399d0966 (patch)
tree59c92ad5c3176b7ba0fdf6b06612aa0b8df4fcd3
parent11b962b8e62695efbacddbab264d4821c53edb17 (diff)
downloadydb-17dbb95cd16a40cae47b42c20177d002399d0966.tar.gz
Update cctz to 2021-03-11
-rw-r--r--contrib/libs/cctz/src/time_zone_fixed.cc2
-rw-r--r--contrib/libs/cctz/test/time_zone_lookup_test.cc12
2 files changed, 13 insertions, 1 deletions
diff --git a/contrib/libs/cctz/src/time_zone_fixed.cc b/contrib/libs/cctz/src/time_zone_fixed.cc
index ce79822ada..6031d7c87e 100644
--- a/contrib/libs/cctz/src/time_zone_fixed.cc
+++ b/contrib/libs/cctz/src/time_zone_fixed.cc
@@ -48,7 +48,7 @@ int Parse02d(const char* p) {
} // namespace
bool FixedOffsetFromName(const std::string& name, seconds* offset) {
- if (name.compare(0, std::string::npos, "UTC", 3) == 0) {
+ if (name == "UTC" || name == "UTC0") {
*offset = seconds::zero();
return true;
}
diff --git a/contrib/libs/cctz/test/time_zone_lookup_test.cc b/contrib/libs/cctz/test/time_zone_lookup_test.cc
index 991d7af1c8..056e076771 100644
--- a/contrib/libs/cctz/test/time_zone_lookup_test.cc
+++ b/contrib/libs/cctz/test/time_zone_lookup_test.cc
@@ -714,6 +714,18 @@ TEST(TimeZones, LoadZonesConcurrently) {
EXPECT_LE(failures.size(), max_failures) << testing::PrintToString(failures);
}
+TEST(TimeZone, UTC) {
+ const time_zone utc = utc_time_zone();
+
+ time_zone loaded_utc;
+ EXPECT_TRUE(load_time_zone("UTC", &loaded_utc));
+ EXPECT_EQ(loaded_utc, utc);
+
+ time_zone loaded_utc0;
+ EXPECT_TRUE(load_time_zone("UTC0", &loaded_utc0));
+ EXPECT_EQ(loaded_utc0, utc);
+}
+
TEST(TimeZone, NamedTimeZones) {
const time_zone utc = utc_time_zone();
EXPECT_EQ("UTC", utc.name());