C++20’s <chrono> Calendars and Time Zones in MSVC
summary
C++20’s chrono in MSVC implements calendrical types, clock_cast conversions, and time zone support; utc_clock tracks leap seconds and clock_cast accounts for epoch differences (example: 10s epoch offset + 27 leap seconds = 37s). Leap seconds post‑2018 are read from the Windows registry while pre‑2018 values live in a static constexpr table. Time zone data comes from ICU on modern Windows (ICU ≈ derived from IANA), and local_time ↔ sys_time can throw ambiguous_local_time or nonexistent_local_time for DST transitions.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 3:36Development Process
- 9:22Some examples: Simple Calendrical Types (continued)
- 11:40Some examples: Compound Calendrical Types
- 18:22Full example
- 19:53Why calendrical types? Type Safety
- 21:30Why calendrical types? Abstraction
- 22:29What is a clock?
- 31:50clock_cast example
- 38:48sys_time and local_time conversions
- 41:28ambiguous_local_time example
- 43:29nonexistent_local_time example
- 47:45The MSVC story for time zone data
- 50:18Differences between IANA and ICU time zone data








