Index: boost/date_time/date_formatting.hpp =================================================================== --- boost/date_time/date_formatting.hpp (revision 68583) +++ boost/date_time/date_formatting.hpp (working copy) @@ -79,7 +79,13 @@ { typedef typename ymd_type::month_type month_type; std::basic_ostringstream ss; + + // Temporarily switch to classic locale to prevent possible formatting + // of year with comma or other character (for example 2,008). + ss.imbue(std::locale::classic()); ss << ymd.year; + ss.imbue(std::locale()); + if (format_type::has_date_sep_chars()) { ss << format_type::month_sep_char(); }