Working with calendars
The chrono
library, available in C++11, offered support for clocks, time points, and durations but did not make it easy for expressing times and dates, especially with respect to calendars and time zones. The new C++20 standard corrects this by extending the existing chrono
library with:
- More clocks, such as a UTC clock, an International Atomic Time clock, a GPS clock, a file time clock, and a pseudo-clock representing local time.
- Time of day, representing the time elapsed since midnight split into hours, minutes, and seconds.
- Calendars, which enable us to express dates with year, month, and day parts.
- Time zones, which enable us to express time points with respect to a time zone and make it possible to convert times between different time zones.
- I/O support for parsing chrono objects from a stream.
In this recipe, we will learn about working with calendar objects.
Getting ready
All the new chrono functionalities...