Boost C++ Libraries: Ticket #13194: Time input facet is not able to parse '%e' day https://svn.boost.org/trac10/ticket/13194 <p> According to documentation, '%e' time format means day of the month with leading space (' 1', ' 2'.. '31') instead of zero ('01', '02'.. '31' for '%d'). It looks like now time input facet is not able to parse this. </p> <pre class="wiki">int main() { const std::string time = "December 07:27:10.435945 1 2017"; boost::posix_time::time_input_facet* facet = new boost::posix_time::time_input_facet("%B %H:%M:%s %e %Y"); std::stringstream ss; ss.imbue(std::locale(std::locale(), facet)); ss &lt;&lt; time; boost::posix_time::ptime pt; ss &gt;&gt; pt; std::cout &lt;&lt; pt &lt;&lt; std::endl; } </pre><p> Following patch helps for me: </p> <pre class="wiki">--- /usr/include/boost/date_time/time_facet.hpp.old 2017-09-05 17:55:25.645625191 +0000 +++ /usr/include/boost/date_time/time_facet.hpp 2017-09-05 17:57:49.205625185 +0000 @@ -1049,9 +1049,10 @@ namespace date_time { break; } case 'd': + case 'e': { try { - t_day = this-&gt;m_parser.parse_day_of_month(sitr, stream_end); + t_day = (*itr == 'd') ? this-&gt;m_parser.parse_day_of_month(sitr, stream_end) : this-&gt;m_parser.parse_var_day_of_month(sitr, stream_end); } catch(std::out_of_range&amp;) { // base class for exception bad_day_of_month match_results mr; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13194 Trac 1.4.3 James E. King, III Thu, 21 Dec 2017 17:02:11 GMT owner changed https://svn.boost.org/trac10/ticket/13194#comment:1 https://svn.boost.org/trac10/ticket/13194#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">az_sw_dude</span> to <span class="trac-author">James E. King, III</span> </li> </ul> <p> Shouldn't your input string be the following (note the double space) to conform with the specification which states "%e: a leading zero is replaced by a space"? </p> <pre class="wiki"> December 07:27:10.435945 1 2017 </pre><p> When I apply your patch, it makes your original sample succeed, as well as the corrected string, however I found some other issues by adding more testing in this area so I will submit a pull request for it. </p> Ticket James E. King, III Thu, 21 Dec 2017 17:02:35 GMT status changed https://svn.boost.org/trac10/ticket/13194#comment:2 https://svn.boost.org/trac10/ticket/13194#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket James E. King, III Thu, 21 Dec 2017 17:46:40 GMT <link>https://svn.boost.org/trac10/ticket/13194#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13194#comment:3</guid> <description> <p> Hmm, definitely want additional thoughts on this one. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Thu, 21 Dec 2017 20:44:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13194#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13194#comment:4</guid> <description> <p> PR is out for this fix: <a class="ext-link" href="https://github.com/boostorg/date_time/pull/54"><span class="icon">​</span>https://github.com/boostorg/date_time/pull/54</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Tue, 26 Dec 2017 15:41:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13194#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13194#comment:5</guid> <description> <p> PR was merged, waiting for it to be moved to master, and waiting for 1.67.0 to appear in the milestone list. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Thu, 18 Jan 2018 13:52:37 GMT</pubDate> <title>version, milestone changed https://svn.boost.org/trac10/ticket/13194#comment:6 https://svn.boost.org/trac10/ticket/13194#comment:6 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost Release Branch</span> → <span class="trac-field-new">Boost 1.66.0</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.67.0</span> </li> </ul> Ticket James E. King, III Sun, 28 Jan 2018 16:25:52 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/13194#comment:7 https://svn.boost.org/trac10/ticket/13194#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fix merged to master; resolved. </p> Ticket