Ticket #1674 (closed Bugs: fixed)
date_time::date_formatting.hpp: incorrectly formats year using global locale
|Reported by:||jplejacq@…||Owned by:||az_sw_dude|
The function boost::date_time::ymd_formatter::ymd_to_string() uses the ostream<<() function to write the date. This later function will use the current global locale to format each of the elements of the date. In particular, when the global locale is set to en_US, the year will be formatted to be 2,008 which is incorrect.
The proposed solution is to temporarily imbue the ostream with the classic locale to disable formatting. The attached patch only applies this to the year but it would be more robust to apply to the day and month components as well.
This type of error probably exists in other functions.