Description: Replace the removed fmt::localtime API
 fmt 12 no longer provides fmt::localtime. Use POSIX localtime_r with
 caller-owned storage, preserving local timezone and DST conversion and
 the previous fmt::format_error on an out-of-range time_t value.
 Leave timestamps without a format specification as numeric epoch seconds.
Forwarded: no
Last-Update: 2026-10-14

Index: source/src/format_from_dict.cc
===================================================================
--- source.orig/src/format_from_dict.cc
+++ source/src/format_from_dict.cc
@@ -21,6 +21,7 @@
  */
 
 #include "format_from_dict.h"
+#include <ctime>
 
 using namespace std;
 using namespace fmt;
@@ -54,7 +55,10 @@ static string scalar_to_string(scalar_t
     time_t val = get<time_t>(scalar);
     if (!spec.length())
       return to_string(val);
-    return format(runtime(format("{{:{}}}", spec)), fmt::localtime(val));
+    std::tm local_time;
+    if (!::localtime_r(&val, &local_time))
+      throw fmt::format_error("time_t value out of range");
+    return format(runtime(format("{{:{}}}", spec)), local_time);
   }
   throw runtime_error("Unrecognized type!"); // I shouldn't be here!
 }
