On Sep 21, 2021, at 10:29 AM, Jan Engelhardt <jengelh@inai.de> wrote:
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.
This issue was discussed in committee, and is a most delicate one (to get the wording right). In the end we believed that this sentence was the best way to describe the set of time zone names: http://eel.is/c++draft/time.zone#general-1
[time.zone] describes an interface for accessing the IANA Time Zone Database that interoperates with sys_time and local_time. This interface provides time zone support to both the civil calendar types ([time.cal]) and to user-defined calendars.
We also added a link the Bibliography section, which is unfortunately not included in the online document:
* IANA Time Zone Database. Available from: https://www.iana.org/time-zones
I was there, and I authored and championed this proposal through the standardization process. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0355r7.html Visual Studio is already shipping it. Howard