From f5c615b0eeecad819cc226d7df9e03ff38064b9a Mon Sep 17 00:00:00 2001 From: Patrick Geltinger Date: Thu, 11 May 2023 16:33:16 +0200 Subject: [PATCH] Fix time_point formatting --- include/fmt/chrono.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 1a2a12cf..43daeeb4 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -2142,7 +2142,8 @@ struct formatter, epoch - std::chrono::duration_cast(epoch)); if (subsecs.count() < 0) { - auto second = std::chrono::seconds(1); + auto second = std::chrono::duration_cast( + std::chrono::seconds(1)); if (epoch.count() < ((Duration::min)() + second).count()) FMT_THROW(format_error("duration is too small")); subsecs += second;