`<chrono>`: `current_zone()` throws on "British Columbia" timezone added in October 2026 Windows updates
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start from the reproduction program in the issue: current_zone() throws 'unable to locate time_zone with given name' on Windows when the system zone is 'Pacific Time (British Columbia)'. The linked microsoft/STL#1911 and microsoft/icu#125 explain how Windows zone names map to IANA names via icu.dll, so read those first. Done means the lookup no longer throws for zones Windows lists, or the failure is handled with a clear path, with the repro passing on a patched machine. The fix may depend on the ICU team, so check that before writing code.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Several new timezones were added to Windows in October 2026, including "Pacific Time (British Columbia)":
- https://techcommunity.microsoft.com/category/windows/blog/dstblog
- https://techcommunity.microsoft.com/blog/dstblog/british-columbia-2026-time-zone-update-available-now/4564507
current_zone() throws on the new 'Pacific Time (British Columbia)' timezone
Command-line test case
PREREQUISITES:
- install Windows updates matching KB numbers on https://techcommunity.microsoft.com/blog/dstblog/british-columbia-2026-time-zone-update-available-now/4564507
- select "Pacific Time (British Columbia)" in Windows timezone settings
PS C:\Users\fred> cat test.cpp
#include <chrono>
#include <print>
int main() try {
using namespace std::chrono;
std::println("Retrieving timezone");
const auto tz = current_zone();
std::println("Retrieving timezone name");
const auto name = tz->name();
std::println("Printing tz name");
std::println("TZ name: {}", name);
std::println("Making zoned time");
const auto zt = zoned_time { tz, system_clock::now() };
std::println("Printing zoned time");
std::println("zoned time {}", zt);
return 0;
} catch (const std::exception& e) {
std::println("Exception: {}", e.what());
return 1;
}
PS C:\Users\fred> cl.exe /std:c++latest test.cpp /EHsc
Microsoft (R) C/C++ Optimizing Compiler Version 19.51.36260 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
/std:c++latest is provided as a preview of language features from the latest C++
working draft, and we're eager to hear about bugs and suggestions for improvements.
However, note that these features are provided as-is without support, and subject
to changes or removal as the working draft evolves. See
https://go.microsoft.com/fwlink/?linkid=2045807 for details.
test.cpp
Microsoft (R) Incremental Linker Version 14.51.36260.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
PS C:\Users\fred> ./test.exe
Retrieving timezone
Exception: unable to locate time_zone with given name
Expected behavior
current_zone() should not throw on timezones included in Windows.
Example output:
PS C:\Users\fred> ./test.exe
Retrieving timezone
Retrieving timezone name
Printing tz name
TZ name: America/Chicago
Making zoned time
Printing zoned time
zoned time 2026-10-16 04:23:52.8498235 CDT
STL version
PS C:\Users\fred> cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.51.36260 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
Additional context
This is related to:
- microsoft/STL#1911
- microsoft/icu#125
I would generally expect existing binaries to continue to work when Windows adds new timezones, including applications that are using previous versions of the STL; IMO the right fix here is for the STL team to attempt to get whichever team is responsible for icu.dll to update that.
- 主要语言
- C++
- 星标
- 11.2k
- 派生
- 1.7k
- 平均合并
- 4 天 4 小时
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/STL 的其他 Issue
-
LWG
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
generator LWG
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
LWG
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
`<__msvc_math.hpp>`: `_USE_MATH_DEFINES` is ignored after the first `<math.h>` include under `/Zc:cmath`可能已有人在做 @tiagomacarios 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
相似的 Issue
-
bug data-types
难度 2/5 1-3 小时 新手友好度 71/100
ClickHouse/clickhouse-odbc#680 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
ionut-mihalache/aqua#31 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
needs-kind
难度 2/5 1-3 小时 新手友好度 63/100
villagesql/villagesql-server#1702 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/vcpkg-tool#2191 · 1 个 reaction ·
维护者通常 1 天内回复