From 09d90a8b5edb6475542cea67d3d0efd7bf37ee78 Mon Sep 17 00:00:00 2001 From: AdrienBellanger <37541570+AdrienBellanger@users.noreply.github.com> Date: Thu, 1 Nov 2018 15:07:20 +0100 Subject: [PATCH] Fix operator<< for years with non C locale Fix the issue https://github.com/HowardHinnant/date/issues/392 --- include/date/date.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/date/date.h b/include/date/date.h index 4e1e3f3..5188268 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -1722,6 +1722,7 @@ operator<<(std::basic_ostream& os, const year& y) os.fill('0'); os.flags(std::ios::dec | std::ios::internal); os.width(4 + (y < year{0})); + os.imbue(std::locale::classic()); os << static_cast(y); if (!y.ok()) os << " is not a valid year";