Skip to content

Commit c82e833

Browse files
committed
feat: Add America/Coyhaique timezone support
Add America/Coyhaique (timezone ID 2234) to the timezone database and timezone names, following the Presto zone-index convention. Also fix the namespace in gen_timezone_database.py (util -> tz) to match the current codebase. America/Coyhaique was added to the IANA timezone database in tzdata 2025b. The upstream Presto PR (prestodb/presto#26981) has been merged. Fixes #16216
1 parent d085d37 commit c82e833

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

velox/type/tz/TimeZoneDatabase.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,7 @@ const std::vector<std::pair<int16_t, std::string>>& getTimeZoneEntries() {
22652265
{2231, "Pacific/Kanton"},
22662266
{2232, "Europe/Kyiv"},
22672267
{2233, "America/Ciudad_Juarez"},
2268+
{2234, "America/Coyhaique"},
22682269
};
22692270
}());
22702271
return *tzDB;

velox/type/tz/TimeZoneNames.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,11 @@ const std::unordered_map<std::string, TimeZoneNames>& getTimeZoneNames() {
11551155
{"Greenwich Mean Time", "GMT", "Greenwich Mean Time", "GMT"}},
11561156
{"America/Costa_Rica",
11571157
{"Central Standard Time", "CST", "Central Daylight Time", "CDT"}},
1158+
{"America/Coyhaique",
1159+
{"Coyhaique Standard Time",
1160+
"GMT-03:00",
1161+
"Coyhaique Daylight Time",
1162+
"GMT-03:00"}},
11581163
{"America/Grand_Turk",
11591164
{"Eastern Standard Time", "EST", "Eastern Daylight Time", "EDT"}},
11601165
{"America/Guadeloupe",

velox/type/tz/gen_timezone_database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include <unordered_map>
5151
#include <vector>
5252
53-
namespace facebook::velox::util {
53+
namespace facebook::velox::tz {
5454
5555
const std::vector<std::pair<int16_t, std::string>>& getTimeZoneEntries() {
5656
static auto* tzDB = new std::vector<std::pair<int16_t, std::string>>([] {
@@ -64,7 +64,7 @@
6464
return *tzDB;
6565
}
6666
67-
} // namespace facebook::velox::util\
67+
} // namespace facebook::velox::tz\
6868
"""
6969
)
7070

velox/type/tz/tests/TimeZoneMapTest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ TEST(TimeZoneMapTest, locateZoneID) {
4444
EXPECT_EQ(2141, locateZoneID("Pacific/Marquesas"));
4545
EXPECT_EQ(2215, locateZoneID("Asia/Chita"));
4646
EXPECT_EQ(2233, locateZoneID("America/Ciudad_Juarez"));
47+
EXPECT_EQ(2234, locateZoneID("America/Coyhaique"));
4748
}
4849

4950
TEST(TimeZoneMapTest, locateZoneUTCAlias) {
@@ -165,6 +166,7 @@ TEST(TimeZoneMapTest, getTimeZoneName) {
165166
EXPECT_EQ("Pacific/Kanton", getTimeZoneName(2231));
166167
EXPECT_EQ("Europe/Kyiv", getTimeZoneName(2232));
167168
EXPECT_EQ("America/Ciudad_Juarez", getTimeZoneName(2233));
169+
EXPECT_EQ("America/Coyhaique", getTimeZoneName(2234));
168170
EXPECT_EQ("-00:01", getTimeZoneName(840));
169171
EXPECT_EQ("UTC", getTimeZoneName(0));
170172
}
@@ -175,6 +177,7 @@ TEST(TimeZoneMapTest, getTimeZoneID) {
175177
EXPECT_EQ(2231, getTimeZoneID("Pacific/Kanton"));
176178
EXPECT_EQ(2232, getTimeZoneID("Europe/Kyiv"));
177179
EXPECT_EQ(2233, getTimeZoneID("America/Ciudad_Juarez"));
180+
EXPECT_EQ(2234, getTimeZoneID("America/Coyhaique"));
178181
EXPECT_EQ(0, getTimeZoneID("UTC"));
179182
EXPECT_EQ(0, getTimeZoneID("GMT"));
180183
EXPECT_EQ(0, getTimeZoneID("Z"));

0 commit comments

Comments
 (0)