Boost C++ Libraries: Ticket #1674: date_time::date_formatting.hpp: incorrectly formats year using global locale https://svn.boost.org/trac10/ticket/1674 <p> The function boost::date_time::ymd_formatter::ymd_to_string() uses the ostream&lt;&lt;() 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. </p> <p> 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. </p> <p> This type of error probably exists in other functions. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1674 Trac 1.4.3 anonymous Thu, 06 Mar 2008 18:14:48 GMT attachment set https://svn.boost.org/trac10/ticket/1674 https://svn.boost.org/trac10/ticket/1674 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_date_time_date_formatting_hpp.patch</span> </li> </ul> Ticket Dean Michael Berris Mon, 31 Jan 2011 14:13:05 GMT <link>https://svn.boost.org/trac10/ticket/1674#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1674#comment:1</guid> <description> <p> Is there a chance we can get this tested as well? Would you care to provide a minimal test case? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dean Michael Berris</dc:creator> <pubDate>Mon, 31 Jan 2011 14:29:27 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/1674 https://svn.boost.org/trac10/ticket/1674 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-date_time-1674.patch</span> </li> </ul> <p> Updated patch to apply cleanly to <a class="changeset" href="https://svn.boost.org/trac10/changeset/68583" title="self contained headers complete">r68583</a> on trunk. </p> Ticket Olexiy Buyanskyy <olexiyb@…> Tue, 24 May 2011 12:07:40 GMT <link>https://svn.boost.org/trac10/ticket/1674#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1674#comment:2</guid> <description> <p> Hi, </p> <p> Any chances to have this bug fixed? I am using 1.46.1 and still see this issue. This is very unexpected and undocumented behaviour to get year with comma inside if locale is set to en_US. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 24 May 2011 15:11:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1674#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1674#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/72132" title="Applied patch; refs #1674">[72132]</a>) Applied patch; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1674" title="#1674: Bugs: date_time::date_formatting.hpp: incorrectly formats year using global ... (closed: fixed)">#1674</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Wed, 01 Jun 2011 15:55:42 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1674#comment:4 https://svn.boost.org/trac10/ticket/1674#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/72330" title="Merge fixes to release; Fixes #1674">[72330]</a>) Merge fixes to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1674" title="#1674: Bugs: date_time::date_formatting.hpp: incorrectly formats year using global ... (closed: fixed)">#1674</a> </p> Ticket