Last active
May 18, 2019 19:58
-
-
Save NewbiZ/304f5f52b9f47967c9e0 to your computer and use it in GitHub Desktop.
Current time string C++
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 <string> | |
#include <ctime> | |
std::string now() | |
{ | |
std::time_t tt = std::time(NULL); | |
std::string s = std::ctime(&tt); | |
return s.substr(0, s.size()-1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment