[tz] Preparing to fork tzdb
howard.hinnant at gmail.com
Mon Sep 20 23:45:21 UTC 2021
On Sep 20, 2021, at 7:23 PM, Watson Ladd <watson at cloudflare.com> wrote:
> On Mon, Sep 20, 2021 at 9:51 AM Howard Hinnant via tz <tz at iana.org> wrote:
>> The C++20 standard has adopted the IANA timezone database (not the code) as the basis for a major part of its API: http://eel.is/c++draft/time.zone#general-1
>> I plea for stability. That doesn’t mean no changes. But it does mean no drastic changes.
> Unfortunately you are held hostage to the wishes of British Canadian
> chicken farmers, Indiana counties, etc, etc. in determining what the
> zones will be.
Adding new zones is not problematic. Removing or changing the names of existing ones is.
> The set of zones may increase due to post-1970 changes
> in ways that we cannot predict. And the C++20 standard thankfully does
> not include the list of zones in the API.
A C++20 programmer can easily obtain the list of time zone names and link names from the already standardized API:
for (auto& tz : std::chrono::get_tzdb().zones)
std::cout << tz.name() << '\n';
for (auto& link : std::chrono::get_tzdb().links)
std::cout << link.name() << '\n';
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: Message signed with OpenPGP
More information about the tz