MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / FormatISO8601DateTime

Function FormatISO8601DateTime

src/util/time.cpp:91–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89int64_t GetTime() { return GetTime<std::chrono::seconds>().count(); }
90
91std::string FormatISO8601DateTime(int64_t nTime)
92{
93 const std::chrono::sys_seconds secs{std::chrono::seconds{nTime}};
94 const auto days{std::chrono::floor<std::chrono::days>(secs)};
95 const std::chrono::year_month_day ymd{days};
96 const std::chrono::hh_mm_ss hms{secs - days};
97 return strprintf("%04i-%02u-%02uT%02i:%02i:%02iZ", signed{ymd.year()}, unsigned{ymd.month()}, unsigned{ymd.day()}, hms.hours().count(), hms.minutes().count(), hms.seconds().count());
98}
99
100std::string FormatISO8601Date(int64_t nTime)
101{

Callers 7

LogTimestampStrMethod · 0.85
InvalidChainFoundMethod · 0.85
EXCLUSIVE_LOCKS_REQUIREDFunction · 0.85
LoadChainTipMethod · 0.85
StartLoggingFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85

Calls 1

countMethod · 0.80

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68