From 2fae542f6a019b13b035fd181a67051e88d64b21 Mon Sep 17 00:00:00 2001 From: Matthias Gabriel Date: Fri, 26 Aug 2016 10:55:05 +0200 Subject: [PATCH] Fix formating of time_points with a resolution finer than system_clock::duration --- date.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/date.h b/date.h index 536add0..a638ebc 100644 --- a/date.h +++ b/date.h @@ -4015,7 +4015,7 @@ format(const std::locale& loc, std::basic_string fmt, } auto& f = use_facet>(loc); basic_ostringstream os; - auto tt = system_clock::to_time_t(sys_time{tp.time_since_epoch()}); + auto tt = system_clock::to_time_t(time_point_cast(sys_time{tp.time_since_epoch()})); std::tm tm{}; #ifndef _MSC_VER gmtime_r(&tt, &tm);