Last active
November 13, 2015 15:56
-
-
Save kristopherjohnson/49fb69b7a489ca4e3268 to your computer and use it in GitHub Desktop.
Print the current time using C++11 facilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| auto now = std::chrono::system_clock::now(); | |
| auto now_c = std::chrono::system_clock::to_time_t(now); | |
| std::cout << std::put_time(std::localtime(&now_c), "%F %T") << '\n'; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found here: http://stackoverflow.com/a/17817079/1175