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);