diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenstore/gc.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp index 17d5e740c..03f0e2ae9 100644 --- a/src/zenstore/gc.cpp +++ b/src/zenstore/gc.cpp @@ -45,10 +45,10 @@ struct fmt::formatter<zen::GcClock::TimePoint> : formatter<string_view> template<typename FormatContext> auto format(const zen::GcClock::TimePoint& TimePoint, FormatContext& ctx) { - std::time_t Time = std::chrono::system_clock::to_time_t(TimePoint); - zen::ExtendableStringBuilder<32> String; - String << std::ctime(&Time); - return formatter<string_view>::format(String.ToView(), ctx); + std::time_t Time = std::chrono::system_clock::to_time_t(TimePoint); + char TimeString[std::size("yyyy-mm-ddThh:mm:ss")]; + std::strftime(std::data(TimeString), std::size(TimeString), "%FT%T", std::localtime(&Time)); + return fmt::format_to(ctx.out(), "{}", TimeString); } }; |