Initial commit
This commit is contained in:
Symlink
+1
@@ -0,0 +1 @@
|
||||
../Makefile
|
||||
@@ -0,0 +1,23 @@
|
||||
#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
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#ifndef UTIL_UTIL_H
|
||||
#define UTIL_UTIL_H
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace DataStorageInterface {
|
||||
namespace Util {
|
||||
|
||||
int GetTimestamp();
|
||||
int GetUTCOffset();
|
||||
|
||||
} // namespace Util
|
||||
} // namespace DataStorageInterface
|
||||
|
||||
#endif // UTIL_UTIL_H
|
||||
Reference in New Issue
Block a user