MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParseISO8601DateTime

Function ParseISO8601DateTime

src/util/time.cpp:169–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169int64_t ParseISO8601DateTime(const std::string& str)
170{
171 static const boost::posix_time::ptime epoch = boost::posix_time::from_time_t(0);
172 static const std::locale loc(std::locale::classic(),
173 new boost::posix_time::time_input_facet("%Y-%m-%dT%H:%M:%SZ"));
174 std::istringstream iss(str);
175 iss.imbue(loc);
176 boost::posix_time::ptime ptime(boost::date_time::not_a_date_time);
177 iss >> ptime;
178 if (ptime.is_not_a_date_time() || epoch > ptime)
179 return 0;
180 return (ptime - epoch).total_seconds();
181}
182
183struct timeval MillisToTimeval(int64_t nTimeout)
184{

Callers 4

importwalletFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85
ConsumeTimeFunction · 0.85

Calls

no outgoing calls

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68
ConsumeTimeFunction · 0.68