Skip to content

Instantly share code, notes, and snippets.

@NewbiZ
Last active May 18, 2019 19:58
Show Gist options
  • Save NewbiZ/304f5f52b9f47967c9e0 to your computer and use it in GitHub Desktop.
Save NewbiZ/304f5f52b9f47967c9e0 to your computer and use it in GitHub Desktop.
Current time string C++
#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