Last active
October 30, 2015 14:10
-
-
Save mfilipelino/1eef069d714cbc417f87 to your computer and use it in GitHub Desktop.
tag: datetime
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
std::string currentDateTime() | |
{ | |
time_t now = time(0); | |
struct tm tstruct; | |
char buf[80]; | |
tstruct = *localtime(&now); | |
strftime(buf, sizeof(buf), "%Y-%m-%d.%X", &tstruct); | |
std::string str(buf); | |
return str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment