| 35 | }; |
| 36 | |
| 37 | static 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 | |
| 56 | class ZDosFilesystem : public Filesystem |
| 57 | { |