Supply missing imbues in format

This commit is contained in:
Howard Hinnant 2016-10-18 11:52:07 -04:00
parent 806c29fddc
commit 9e25c2d74f

2
date.h
View File

@ -4006,6 +4006,7 @@ format(const std::locale& loc, std::basic_string<CharT, Traits> fmt,
{
auto offset = duration_cast<minutes>(*offset_sec);
basic_ostringstream<CharT, Traits> os;
os.imbue(loc);
if (offset >= minutes{0})
os << '+';
os << make_time(offset);
@ -4042,6 +4043,7 @@ format(const std::locale& loc, std::basic_string<CharT, Traits> fmt,
}
auto& f = use_facet<time_put<CharT>>(loc);
basic_ostringstream<CharT, Traits> os;
os.imbue(loc);
auto ld = floor<days>(tp);
auto ymd = year_month_day{ld};
auto hms = make_time(floor<seconds>(tp - ld));