24 lines
383 B
C++
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(¤t_time);
|
|
struct std::tm *timeinfo = std::localtime(¤t_time);
|
|
return timeinfo->tm_gmtoff;
|
|
}
|
|
|
|
} // namespace Util
|
|
} // namespace DataStorageInterface
|