You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Outside of a few remaining bugs (for which we have filed issues), we are feature-complete! 🎉
🗺️ Roadmap
There are several PRs who have contributed work toward completion of this feature! See the <chrono> project for a complete list.
The time-zone related work in <chrono> had many moving parts, many of which depended on each other. The rough dependency graph below helped guide the order of implementation for the various pieces (e.g., sys_info, local_info ➡️ zoned_time means that sys_info, local_info are required for zoned_time).
The different colored outlines suggest what pieces might makes sense to implement in a single PR (note that these are suggestions, not requirements).
Note that some aspects of [time.zone] are best-implemented for more recent OSes (specifically, utilization of the icu.dll for time zone information, leap second registry calls, etc.). To declare feature completion, we are satisfied with merging implementations for these more recent OSes. We've filed <chrono>: Implement fallback mechanism for chrono's [time.zone] #1911 to track this work.
⌨️ Blogpost / Documentation Notes
The ICU DLL we are using for time-zone-related data is only available in more recent Windows OSes (19H1 and after). We plan to come back and implement a fallback for older OSes, but this will likely not be included in the initial implementation.
If we stick with the file_clock::to_utc and file_clock::from_utc implementations (instead of the to_sys, from_sys option instead), we should include the note that pre-2017 leap seconds will not be representable through file_time (as FILETIME only became leap-second-aware as of Server 2019 and Windows 10 October update).
The ICU API classifies time zones and alternate names for time zones ("canonical" and "non-canonical"), and these categorizations differ from what the IANA database considers to be "standard" and "alternate" names (alternate names used for time_zone_link).
Unfortunately, there is no easy mapping between these two classification systems. Without attempting to list and maintain a complete list of all IANA-"standard" time zones and IANA-"alternate" names, there is no way to cleanly create an identical mapping.
Instead, we will consider all of the ICU time zones (canonical and non-canonical) to be time_zones, and have no time_zone_links. This means that we will supply a superset of the IANA standard and alternate time zones as time_zones, with a few exceptions:
The "America/Nuuk" time zone does not appear in the ICU database, but we expect it is because it is a very recent name change from "America/Godthab" in April 2020 (and "America/Godthab" does appear in the ICU database).
There are a few somewhat abnormal time zones in the IANA database that do not appear in the ICU database (such as Eastern War Time EWT) - we will report these missing time zones as bugs to ICU, if they are still not found in more recent versions.
sys_info contains begin and end members whose intent is described here: [time.zone.info.sys]/3 - their range is not specified, but we plan to enforce that they are clamped at chrono::year::min() and chrono::year::max().
Much of our [time.format] implementation relies on strftime for handling of many of the specifiers. Currently, strftime does not yet support some of the modifiers (e.g., O and E) that it should, and support for this is not expected anytime soon (due dependency on Win32 locale APIs). We do not attempt to handle these cases manually, but our implementation should be conformant in this respect ifstrftime's implementation also becomes conformant.
I built a table of the "chronat" types and which format specifiers were valid for them, as this information needed to be inferred from the Standard: chronat_table.pdf
📄 Primary Sources
<chrono>Calendars And Time Zones<chrono>Calendars And Time Zones<chrono>std::chrono::daysWith Suffix"d"leapToleap_secondlinkTotime_zone_link🚧 Status
<chrono>project🗺️ Roadmap
<chrono>project for a complete list.<chrono>had many moving parts, many of which depended on each other. The rough dependency graph below helped guide the order of implementation for the various pieces (e.g.,sys_info,local_info➡️zoned_timemeans thatsys_info,local_infoare required forzoned_time).<chrono>: Implement fallback mechanism for chrono's[time.zone]#1911 to track this work.⌨️ Blogpost / Documentation Notes
file_clock::to_utcandfile_clock::from_utcimplementations (instead of theto_sys,from_sysoption instead), we should include the note that pre-2017 leap seconds will not be representable throughfile_time(asFILETIMEonly became leap-second-aware as of Server 2019 and Windows 10 October update).time_zone_link).time_zones, and have notime_zone_links. This means that we will supply a superset of the IANA standard and alternate time zones astime_zones, with a few exceptions:sys_infocontainsbeginandendmembers whose intent is described here: [time.zone.info.sys]/3 - their range is not specified, but we plan to enforce that they are clamped atchrono::year::min()andchrono::year::max().[time.format]implementation relies onstrftimefor handling of many of the specifiers. Currently,strftimedoes not yet support some of the modifiers (e.g.,OandE) that it should, and support for this is not expected anytime soon (due dependency on Win32 locale APIs). We do not attempt to handle these cases manually, but our implementation should be conformant in this respect ifstrftime's implementation also becomes conformant.