Instead of using std::chrono::system_clock::now();
I would like to set my own specific hours\minutes\seconds.
Similar to how one would go about using struct tm to manually construct a date-time.
What is the best way of doing this?
I've found a solution I was looking for. See: A solution by Howard Hinnant
Basically you should use a 24hr duration
using days = std::chrono::duration<int, std::ratio<86400>>;
auto last_midnight = std::chrono::time_point_cast<days>(std::chrono::system_clock::now());
Then add the 24hr timestamp to it :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With