diff --git a/Common/Utils/src/FileFetcher.cxx b/Common/Utils/src/FileFetcher.cxx index 3f24ee811b42b..794486266326e 100644 --- a/Common/Utils/src/FileFetcher.cxx +++ b/Common/Utils/src/FileFetcher.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -243,8 +244,10 @@ void FileFetcher::cleanup() const auto systemTime = std::chrono::time_point_cast( fileTime - fs::file_time_type::clock::now() + std::chrono::system_clock::now()); const auto modificationTime = std::chrono::system_clock::to_time_t(systemTime); + std::tm localTime{}; + localtime_r(&modificationTime, &localTime); const auto size = entry.is_regular_file() ? std::to_string(entry.file_size()) : "-"; - LOGP(info, "{:%Y-%m-%d %H:%M:%S} {} {}", fmt::localtime(modificationTime), size, entry.path().filename().string()); + LOGP(info, "{:%Y-%m-%d %H:%M:%S} {} {}", localTime, size, entry.path().filename().string()); } } catch (const std::exception& e) { LOGP(error, "FileFetcher failed to list scratch directory {}: {}", mCopyDirName, e.what());