A Crash Course in Calendars, Dates, Time, and Time Zones
summary
C++20 chrono features get practical exercises and gotchas not just names: compile time ratio arithmetic and the predefined SI aliases, how to build and convert durations with duration_cast and user literals, using system_clock and high_resolution_clock for timing, constructing dates like the 3rd Monday or last day and converting between field and serial representations, the surprising one‑year addition behavior that uses average years, and time zone work using zoned_time and the tz database via get_tzdb with examples that compile and show actual outputs.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:32Topics
- 1:23Rational Numbers
- 1:52Rational Numbers Compilation
- 5:17Durations
- 7:40Arithmetic
- 9:30Conversion
- 10:52Standard UserDefined literals
- 12:48Clocks
- 15:45Time Points
- 18:22Dates
- 21:28System Time
- 25:58Time Zones
- 27:54Questions








