“A C++14 approach to dates and times"
summary
A compact C++14 date/time library (date.h, plus optional tz.h) implements single-header extensions to std::chrono: a serial daypoint time_point, lightweight field types (year/month/day, year/month/weekday, last), and constexpr algorithms so many conversions and epoch math happen at compile time. It allows constructing invalid dates and deferring handling (checkable with ok()), parses the IANA tz database including leap seconds, throws no exceptions, and beats heavy implementations in size and cold-cache speed (library object ≈15KB; competitor full app ≈132KB; hot/cold timings in the 100–300ns vs 89ns/3µs ranges).
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:06Library Overview
- 3:07Date Algorithms
- 5:15Type Safe Objects
- 6:52Cute API Syntax
- 9:05Year Month Day Struct
- 12:27Handling Invalid Dates
- 16:56Last Day and Weekday
- 20:22Daypoint and Arithmetic
- 24:37DateTime Operations
- 29:09Performance Analysis
- 33:56Runtime Benchmarking
- 45:43Calendar Arithmetic
- 48:48Time Zone Library
- 51:45Summary and Questions
related talks
01h 05mWelcome To The Time Zone
01h 06mRebuilding Boost Date-Time for C++11
01h 21mHow Old Am I in Seconds? Insights From the C++ chrono Library
03m<chrono> Then and Now
51mUsing std::chrono Calendar Dates for Finance in Cpp
59mC++20 - My Favourite Code Examples
01h 00mThe C++20 Standard Library: Beyond Ranges
29mTemporal: Keep Time on Your Side
