mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
tunnels through ECIES routers
This commit is contained in:
parent
57d6c7a3b3
commit
c93ee0d65d
6 changed files with 137 additions and 39 deletions
|
@ -35,18 +35,24 @@ namespace util
|
|||
std::chrono::system_clock::now().time_since_epoch()).count ();
|
||||
}
|
||||
|
||||
static uint32_t GetLocalHoursSinceEpoch ()
|
||||
{
|
||||
return std::chrono::duration_cast<std::chrono::hours>(
|
||||
std::chrono::system_clock::now().time_since_epoch()).count ();
|
||||
}
|
||||
|
||||
static uint64_t GetLocalSecondsSinceEpoch ()
|
||||
{
|
||||
return std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch()).count ();
|
||||
}
|
||||
|
||||
static uint32_t GetLocalMinutesSinceEpoch ()
|
||||
{
|
||||
return std::chrono::duration_cast<std::chrono::minutes>(
|
||||
std::chrono::system_clock::now().time_since_epoch()).count ();
|
||||
}
|
||||
|
||||
static uint32_t GetLocalHoursSinceEpoch ()
|
||||
{
|
||||
return std::chrono::duration_cast<std::chrono::hours>(
|
||||
std::chrono::system_clock::now().time_since_epoch()).count ();
|
||||
}
|
||||
|
||||
static int64_t g_TimeOffset = 0; // in seconds
|
||||
|
||||
static void SyncTimeWithNTP (const std::string& address)
|
||||
|
@ -178,14 +184,19 @@ namespace util
|
|||
return GetLocalMillisecondsSinceEpoch () + g_TimeOffset*1000;
|
||||
}
|
||||
|
||||
uint32_t GetHoursSinceEpoch ()
|
||||
{
|
||||
return GetLocalHoursSinceEpoch () + g_TimeOffset/3600;
|
||||
}
|
||||
|
||||
uint64_t GetSecondsSinceEpoch ()
|
||||
{
|
||||
return GetLocalSecondsSinceEpoch () + g_TimeOffset;
|
||||
}
|
||||
|
||||
uint32_t GetMinutesSinceEpoch ()
|
||||
{
|
||||
return GetLocalMinutesSinceEpoch () + g_TimeOffset/60;
|
||||
}
|
||||
|
||||
uint32_t GetHoursSinceEpoch ()
|
||||
{
|
||||
return GetLocalHoursSinceEpoch () + g_TimeOffset/3600;
|
||||
}
|
||||
|
||||
void GetCurrentDate (char * date)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue