File paps-fmt-localtime.patch of Package paps

diff --git a/src/format_from_dict.cc b/src/format_from_dict.cc
index 5d0a1f2..b3c9a6a 100644
--- a/src/format_from_dict.cc
+++ b/src/format_from_dict.cc
@@ -47,12 +47,13 @@ static string scalar_to_string(scalar_t scalar,
       return to_string(val);
     return format(runtime(format("{{:{}}}", spec)), val);
   }
   if (holds_alternative<time_t>(scalar))
   {
     time_t val = get<time_t>(scalar);
     if (!spec.length())
       return to_string(val);
-    return format(runtime(format("{{:{}}}", spec)), fmt::localtime(val));
+    auto tm = *std::localtime(&val);
+    return format(runtime(format("{{:{}}}", spec)), tm);
   }
   throw runtime_error("Unrecognized type!"); // I shouldn't be here!
 }
 
 // Take a python like format string and a dictionary and format
 // it according to the format string.
 string format_from_dict(const string& str,
                         dict_t dict)
 {
diff --git a/src/format_from_dict.h b/src/format_from_dict.h
index 4a88a3d..20a1b67 100644
--- a/src/format_from_dict.h
+++ b/src/format_from_dict.h
@@ -21,6 +21,7 @@
 #define FORMAT_FROM_DICT_H
 
 #include <string>
 #include <map>
 #include <variant>
+#include <ctime>
 #include <fmt/chrono.h>
 
 using scalar_t = std::variant<int, std::string, double, std::time_t>;
 using dict_t = std::map<std::string, scalar_t>;
openSUSE Build Service is sponsored by