Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- string asString (const chrono::system_clock::time_point& tp)
- {
- time_t t = chrono::system_clock::to_time_t(tp);
- string ts = asctime(gmtime(&t));
- ts.resize(ts.size()-1);
- return ts;
- }
- int main() {
- chrono::system_clock::time_point tp;
- cout << "epoch: " << asString(tp) << endl;
- tp = chrono::system_clock::now();
- cout << "now: " << asString(tp) << endl;
- tp = chrono::system_clock::time_point::max();
- cout << "max: " << asString(tp) << endl;
- tp = chrono::system_clock::time_point::min();
- cout << "min: " << asString(tp) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement