Skip to content

Instantly share code, notes, and snippets.

@kristopherjohnson
Last active November 13, 2015 15:56
Show Gist options
  • Select an option

  • Save kristopherjohnson/49fb69b7a489ca4e3268 to your computer and use it in GitHub Desktop.

Select an option

Save kristopherjohnson/49fb69b7a489ca4e3268 to your computer and use it in GitHub Desktop.
Print the current time using C++11 facilities
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';
@kristopherjohnson
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment