Boost C++ Libraries: Ticket #5041: single digit year given when using %y in format string when stlport standard library in use https://svn.boost.org/trac10/ticket/5041 <p> I'm using solaris studio 12.2 on SPARC and boost 1.45. </p> <p> When running a simple facet example I get a single digit year when the format string contains a %y and the year is less than 10. </p> <p> ie the following simple program: </p> <p> #include &lt;boost/date_time/gregorian/gregorian.hpp&gt; </p> <p> int main() { </p> <blockquote> <p> boost::gregorian::date localDate(2006,1,9); std::ostringstream ostr; </p> <blockquote> <p> static std::locale locsmlocdmy(std::locale::classic(), new boost::gregorian::date_facet("%d%m%y")); </p> </blockquote> <p> ostr.imbue(locsmlocdmy); ostr &lt;&lt; localDate; </p> </blockquote> <p> std::cout &lt;&lt; ostr.str() &lt;&lt; std::endl; </p> <p> } </p> <p> gives 09016 instead of 090106. </p> <p> the same thing happens when using a ptime and a time_facet. </p> <p> i also had an old boost version kicking around (1.33.1) and this exhibited the same problem! </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5041 Trac 1.4.3 cris@… Thu, 06 Jan 2011 10:42:27 GMT cc set https://svn.boost.org/trac10/ticket/5041#comment:1 https://svn.boost.org/trac10/ticket/5041#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">cris@…</span> added </li> </ul> Ticket crispin.boylan@… Fri, 07 Jan 2011 16:43:39 GMT <link>https://svn.boost.org/trac10/ticket/5041#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5041#comment:2</guid> <description> <p> i've tracked this down to an stlport bug. it seems that no leading 0's are appended on %y, %W and %j which is contrary to what strftime would produce. </p> <p> this bug exists in the version of stlport shipped with Solaris Studio 12.2 (4.2.3). It is not fixed in the latest stlport version either from the looks of the code. </p> <p> should this be worked around for stlport users? </p> </description> <category>Ticket</category> </item> <item> <author>crispin.boylan@…</author> <pubDate>Fri, 07 Jan 2011 16:45:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5041#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5041#comment:3</guid> <description> <p> sorry, forgot to mention its actually the time_put facet which is at fault here. </p> <p> the offending code is in time_facets.cpp the method <span class="underline">write_formatted_timeT </span></p> </description> <category>Ticket</category> </item> <item> <author>crispin.boylan@…</author> <pubDate>Mon, 17 Jan 2011 14:02:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5041#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5041#comment:4</guid> <description> <p> this is actually an stlport bug, existing in all released versions (but partially fixed in the unreleased git version). </p> <p> the solaris compiler bug is: </p> <p> <a class="ext-link" href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7011081"><span class="icon">​</span>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7011081</a> </p> <p> the stlport bug is: </p> <p> <a class="ext-link" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=3154701&amp;group_id=146814&amp;atid=766244"><span class="icon">​</span>http://sourceforge.net/tracker/index.php?func=detail&amp;aid=3154701&amp;group_id=146814&amp;atid=766244</a> </p> </description> <category>Ticket</category> </item> <item> <author>crispin.boylan@…</author> <pubDate>Mon, 17 Jan 2011 14:03:40 GMT</pubDate> <title>summary changed https://svn.boost.org/trac10/ticket/5041#comment:5 https://svn.boost.org/trac10/ticket/5041#comment:5 <ul> <li><strong>summary</strong> <span class="trac-field-old">single digit year given when using %y in format string on solaris studio</span> → <span class="trac-field-new">single digit year given when using %y in format string when stlport standard library in use</span> </li> </ul> Ticket acharles Thu, 13 Mar 2014 22:11:02 GMT <link>https://svn.boost.org/trac10/ticket/5041#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5041#comment:6</guid> <description> <p> Fix in develop. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Sun, 16 Mar 2014 01:17:14 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5041#comment:7 https://svn.boost.org/trac10/ticket/5041#comment:7 <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">wontfix</span> </li> </ul> <p> Closing this bug. What acharles meant by "fixed in develop" was that we added a test for %y with a year &lt; 10 to the test suite. </p> <p> This is really a STLPort bug; but there may never be another release of STLPort. </p> Ticket