Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

With C++20, the std::chrono library received a major update, introducing (among other things) support for representing dates. An abstract (not necessarily valid) date can be represented using the std::chrono::year_month_day type, which supports arithmetic operations for years and months. An abstract date can be normalized to a system time, which also supports day arithmetic operations. System time truncated to second precision conceptually represents a date + time (std::chrono::sys_seconds), and truncated to day precision represents a date only (std::chrono::sys_days). Finally, std::chrono::weekday can be constructed from a system time to obtain the weekday. Compiler Explorer link: https://lnkd.in/etEVDcuf #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text
Federico Gnesotto

ImFusion GmbH407 followers

1y

Would be great to see more on conversions between clocks and time zones! I recently discovered that the system time zone database on Windows is pretty much hopelessly flawed and the time-zone support on clang is still quite limited!

Like
Reply

To view or add a comment, sign in

Explore content categories