Convert 32 bit unix timestamp to std::string using std::chrono
问题 I am trying to use std::chrono to make a std::string but running into issues. Here is the C(-ish) code I want to mimick: std::uint32_t time_date_stamp = 1484693089; char date[100]; struct tm *t = gmtime(reinterpret_cast<const time_t*>(&time_date_stamp)); strftime(date, sizeof(date), "%Y-%m-%d %I:%M:%S %p", t); My starting point is always this std::uint32_t , it is from a data format I do not control. Sorry I do not have any C++ as a starting point, I do not even know how to make a std::chrono