Skip to content

Tracking Issue for Extensions to Chrono  #1704

Description

📄 Primary Sources

🚧 Status

  • The primary resource for status updates is the Extensions to <chrono> project
  • 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).

time_zone_planning

⌨️ 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    chronoC++20 chronoresolvedSuccessfully resolved without a commit

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions