How can I convert a chrono duration to a time_point, which is later than clock's epoch with the given duration? I tried to find epoch time in chrono clock without success.
From [time.point.cons]/p2:
template <class Clock, class Duration = typename Clock::duration>
class time_point
{
public:
constexpr explicit time_point(const duration& d); // same as time_point() + d
This can be used (for example) like:
using namespace std::chrono;
system_clock::time_point tp{30min}; // Needs C++14 for the literal
Though the system_clock::time_point is not specified in the standard, in practice this creates a time_point
referring to 1970-01-01 00:30:00 UTC.
The epoch of system_clock
is now specified to be 1970-01-01 00:00:00 UTC.