MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / convertTime

Function convertTime

lib/vfs/zdos.cc:37–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37static std::string convertTime(std::string zdosTime)
38{
39 /* Due to a bug in std::get_time, we can't parse the string directly --- a
40 * pattern of %y%m%d causes the first four digits of the string to become
41 * the year. So we need to reform the string. */
42
43 zdosTime = fmt::format("{}-{}-{}",
44 zdosTime.substr(0, 2),
45 zdosTime.substr(2, 2),
46 zdosTime.substr(4, 2));
47
48 std::tm tm = {};
49 std::stringstream(zdosTime) >> std::get_time(&tm, "%y-%m-%d");
50
51 std::stringstream ss;
52 ss << std::put_time(&tm, "%FT%T%z");
53 return ss.str();
54}
55
56class ZDosFilesystem : public Filesystem
57{

Callers 1

ZDosDirentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected