0
GGGiovanny Gongora
Get timestamp from localtime
0 Comments
#include <iostream> using namespace std; std::string get_timestamp() { time_t now = time(NULL); struct tm* ltm = localtime(&now); char buffer[80]; strftime(buffer, 80, "%Y-%m-%d-%H-%M-%S", ltm); return std::string(buffer); }