`<chrono>`: `current_zone()` throws on "British Columbia" timezone added in October 2026 Windows updates

オープン
#6,490 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
backend

調査の方向性

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 の本文から書いたものです。

説明

bug chrono external

Describe the bug

Several new timezones were added to Windows in October 2026, including "Pacific Time (British Columbia)":

current_zone() throws on the new 'Pacific Time (British Columbia)' timezone

Command-line test case

PREREQUISITES:

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時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/STL のほかの issue

microsoft/STL の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。