Created
August 20, 2013 09:23
-
-
Save ugovaretto/6279247 to your computer and use it in GitHub Desktop.
Print local time with C++11
This file contains 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
#include <iostream> | |
#include <iomanip> | |
#include <chrono> | |
int main(int, char**) { | |
std::chrono::time_point< std::chrono::system_clock> tp; | |
tp = std::chrono::system_clock::now(); | |
const std::time_t t = std::chrono::system_clock::to_time_t(tp); | |
std::cout << asctime(localtime(&t)) << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment