[tz] Preparing to fork tzdb
Howard Hinnant
howard.hinnant at gmail.com
Tue Sep 21 13:20:32 UTC 2021
On Sep 21, 2021, at 1:49 AM, Steve Allen via tz <tz at iana.org> 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';
>
>> Output:
>>
>> 1957-06-06 00:30:10 TAI
>
> anything that produces a value of TAI for a date in 1957 has created a
> fantasy world that does not correspond to reality.
After I hit send I thought I may have gone a step too far in converting to TAI. Leaving that conversion out simplifies things and does not negate my point: that 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';
Output:
1957-06-06 00:30:00 UTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://mm.icann.org/pipermail/tz/attachments/20210921/f95f54c7/attachment.sig>
More information about the tz
mailing list