diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 7e04e5d0..a8a619f7 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -405,13 +405,6 @@ inline size_t strftime(wchar_t* str, size_t count, const wchar_t* format, FMT_END_DETAIL_NAMESPACE -template ::min() < std::chrono::duration::zero()>> -constexpr std::chrono::duration abs(std::chrono::duration d) -{ - return d >= d.zero() ? d : -d; -} - template struct formatter>, Char> : formatter { @@ -421,7 +414,10 @@ struct formatter(epoch); - auto subseconds = abs(std::chrono::duration_cast>(epoch - seconds)); + // auto subseconds = abs(std::chrono::duration_cast>(epoch - seconds)); + auto subseconds = std::chrono::duration_cast>(epoch - seconds); + + if (subseconds < subseconds.zero()) subseconds = -subseconds; if (subseconds.count() > 0) { auto width = std::to_string(Period::den).size() - 1;