[Boost-bugs] [Boost C++ Libraries] #5041: single digit year given when using %y in format string on solaris studio

Subject: [Boost-bugs] [Boost C++ Libraries] #5041: single digit year given when using %y in format string on solaris studio
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-06 10:41:28


#5041: single digit year given when using %y in format string on solaris studio
---------------------------------------+------------------------------------
 Reporter: crispin.boylan@… | Owner: az_sw_dude
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
  Version: Boost 1.45.0 | Severity: Problem
 Keywords: |
---------------------------------------+------------------------------------
 I'm using solaris studio 12.2 on SPARC and boost 1.45.

 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.

 ie the following simple program:

 #include <boost/date_time/gregorian/gregorian.hpp>

 int main() {

         boost::gregorian::date localDate(2006,1,9);
         std::ostringstream ostr;
                 static std::locale locsmlocdmy(std::locale::classic(), new
 boost::gregorian::date_facet("%d%m%y"));
         ostr.imbue(locsmlocdmy);
         ostr << localDate;

 std::cout << ostr.str() << std::endl;

 }


 gives 09016 instead of 090106.

 the same thing happens when using a ptime and a time_facet.

 i also had an old boost version kicking around (1.33.1) and this exhibited
 the same problem!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5041>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC