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

Function FormatISO8601Date

src/util/time.cpp:100–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100std::string FormatISO8601Date(int64_t nTime)
101{
102 const std::chrono::sys_seconds secs{std::chrono::seconds{nTime}};
103 const auto days{std::chrono::floor<std::chrono::days>(secs)};
104 const std::chrono::year_month_day ymd{days};
105 return strprintf("%04i-%02u-%02u", signed{ymd.year()}, unsigned{ymd.month()}, unsigned{ymd.day()});
106}
107
108std::optional<int64_t> ParseISO8601DateTime(std::string_view str)
109{

Callers 3

BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85
ToStringMethod · 0.85

Calls

no outgoing calls

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68