mirror of
https://github.com/monero-project/monero.git
synced 2025-06-21 21:44:09 -04:00
Merge pull request #4880
96e6b439
blockchain_stats: don't use gmtime_r on Windows (moneromooo-monero)
This commit is contained in:
commit
d4a0fb2b89
4 changed files with 13 additions and 12 deletions
|
@ -234,7 +234,7 @@ plot 'stats.csv' index "DATA" using (timecolumn(1,"%Y-%m-%d")):4 with lines, ''
|
|||
}
|
||||
time_t tt = blk.timestamp;
|
||||
char timebuf[64];
|
||||
gmtime_r(&tt, &currtm);
|
||||
epee::misc_utils::get_gmt_time(tt, currtm);
|
||||
if (!prevtm.tm_year)
|
||||
prevtm = currtm;
|
||||
// catch change of day
|
||||
|
|
|
@ -6731,11 +6731,7 @@ static std::string get_human_readable_timestamp(uint64_t ts)
|
|||
return "<unknown>";
|
||||
time_t tt = ts;
|
||||
struct tm tm;
|
||||
#ifdef WIN32
|
||||
gmtime_s(&tm, &tt);
|
||||
#else
|
||||
gmtime_r(&tt, &tm);
|
||||
#endif
|
||||
epee::misc_utils::get_gmt_time(tt, tm);
|
||||
uint64_t now = time(NULL);
|
||||
uint64_t diff = ts > now ? ts - now : now - ts;
|
||||
strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &tm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue