From 6b3ea4516abed26cd67f64c5f886c624d0b8fa01 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sat, 26 Nov 2016 13:37:38 -0500 Subject: [PATCH] Fix bugs with formatting fractional seconds --- date.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/date.h b/date.h index 919aa28..36091bc 100644 --- a/date.h +++ b/date.h @@ -3437,7 +3437,10 @@ struct make_precision static CONSTDATA unsigned width = 6; }; -template ::value> +template ::type::period::den>::value> class decimal_format_seconds { public: @@ -4475,7 +4478,10 @@ to_stream(std::basic_ostream& os, const CharT* fmt, if (command) { if (modified == CharT{}) - os << make_time(tp - floor(tp)); + { + using CT = typename common_type::type; + os << time_of_day{tp - floor(tp)}; + } else { os << CharT{'%'} << modified << *fmt;