There is a hobby project that I’m doing and found myself in need of using date/time facilities available in the chrono library. My tasks at this stage are simple:
- Get the current date and time
- Get date and time beginning midnight
- Do some comparison between (1) and (2)
There are two clocks of interest in the chrono library: system_clock and steady_clock. What is a clock you may ask? Well, in this context, a clock is a time provider that has a starting point (epoch) and tick rate.