Reputation: 123
In some place I already get the epoch time value like this:
int64_t timeSeconds = std::chrono::duration_cast<std::chrono::seconds>(m_startTime.time_since_epoch()).count()
But how to convert this back to "std::chrono::system_clock::time_point"
Upvotes: 10
Views: 5760
Reputation: 218860
std::chrono::system_clock::time_point tp{std::chrono::seconds{timeSeconds}};
seconds
and then turn this duration
into a time_point
.Upvotes: 15