Files
AlarmServer/util.cpp
T
2017-04-28 18:45:26 +02:00

18 lines
276 B
C++

#include <ctime>
#include <string>
#include "util.h"
std::string getTimeString()
{
time_t rawtime;
struct tm* timeinfo;
char buffer[80];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer, 80, "%Y%m%d-%H%M%S", timeinfo);
return std::string(buffer);
}