Files
DataStorageInterface/Util/Util.cpp
T
2020-05-01 11:27:56 +02:00

24 lines
383 B
C++

#include "Util.h"
#include <algorithm>
#include <ctime>
namespace DataStorageInterface {
namespace Util {
int GetTimestamp()
{
return std::time(nullptr);
}
int GetUTCOffset()
{
std::time_t current_time;
std::time(&current_time);
struct std::tm *timeinfo = std::localtime(&current_time);
return timeinfo->tm_gmtoff;
}
} // namespace Util
} // namespace DataStorageInterface