MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / GetDateString

Function GetDateString

libi2pd/Timestamp.cpp:260–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258 }
259
260 void GetDateString (uint64_t timestamp, char * date)
261 {
262 using clock = std::chrono::system_clock;
263 auto t = clock::to_time_t (clock::time_point (std::chrono::seconds(timestamp)));
264 struct tm tm;
265#ifdef _WIN32
266 gmtime_s(&tm, &t);
267 sprintf_s(date, 9, "%04i%02i%02i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
268#else
269 gmtime_r(&t, &tm);
270 sprintf(date, "%04i%02i%02i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
271#endif
272 }
273
274 void AdjustTimeOffset (int64_t offset)
275 {

Callers 5

BlindTestFunction · 0.85
GetCurrentDateFunction · 0.85
GetNextDayDateFunction · 0.85

Calls

no outgoing calls

Tested by 1

BlindTestFunction · 0.68