[tz] Preparing to fork tzdb

Jan Engelhardt jengelh at inai.de
Tue Sep 21 14:29:39 UTC 2021


On Tuesday 2021-09-21 15:20, Howard Hinnant via tz wrote:
>> On Mon 2021-09-20T23:34:25-0400 Howard Hinnant via tz hath writ:
>>>        zoned_time zt{"America/Port-au-Prince", local_days{1957y/June/5} + 19h + 30min};
>>>        cout << format("%F %T %Z", clock_cast<tai_clock>(zt.get_sys_time())) << '\n';
>
>[...] IANA time zone names are part of the C++20 API, and pre-1970 data
>is expected (best effort of course):
>
>     zoned_time zt{"America/Port-au-Prince", local_days{1957y/June/5} + 19h + 30min};
>     cout << format("%F %T %Z", zt.get_sys_time()) << '\n';

I can't really find substance to this claim.

The API [speaking of the locate_zone() function] wants a string, but it does
not specify which particular string value(s) is/are needed to get any
particular zone. locate_zone can succeed or it can fail. In that regard, it is
similar to openssl's

	EVP_getdigestbyname("MD5")

Speaking of openssl, if the C++ standard had wanted to encode timezones in the
API, they would have probably done it like openssl, as a function or object:

	EVP_DigestInit(somectx, EVP_md5());


More information about the tz mailing list