[Boost-bugs] [Boost C++ Libraries] #8528: time_input_facet doesn't support %e

Subject: [Boost-bugs] [Boost C++ Libraries] #8528: time_input_facet doesn't support %e
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-30 15:20:56

#8528: time_input_facet doesn't support %e
 Reporter: galbraithjoseph@… | Owner: az_sw_dude
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: |
 time_input_facet doesn't support the %e substitution for days without
 leading zero.

 This means that the following code for parsing RFC 2822 dates fails:

 auto time_facet = new boost::posix_time::time_input_facet;
 time_facet->format("%a, %e %b %Y %H:%M:%S");

 Test strings (note that time zone portion is not parsed):

 Tue, 15 Jan 2013 06:50:21 -0700
 Wed, 9 Jan 2013 12:33:57 -0700

 Also note that the second date makes %a, %d %b %Y a non-starter.

 The attached patch fixes the problem for me. The patch is against 1.51,
 but I check the 1.53 code and upon a brief code inspection it didn't
 appear to have changed significantly.

 Note that I made no attempt to verify how it behaves on badly constructed
 input; I simply cloned the %d code and changed it to call
 parse_var_day_of_month() instead of parse_day_of_month().

Ticket URL: <https://svn.boost.org/trac/boost/ticket/8528>
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:13 UTC