Skip to content

Commit

Permalink
Fix time_point formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
patlkli committed May 11, 2023
1 parent 8f18e72 commit f5c615b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,8 @@ struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
epoch - std::chrono::duration_cast<std::chrono::seconds>(epoch));

if (subsecs.count() < 0) {
auto second = std::chrono::seconds(1);
auto second = std::chrono::duration_cast<Duration>(
std::chrono::seconds(1));
if (epoch.count() < ((Duration::min)() + second).count())
FMT_THROW(format_error("duration is too small"));
subsecs += second;
Expand Down

0 comments on commit f5c615b

Please sign in to comment.