Boost C++ Libraries: Ticket #4870: ISO Timestamp Parsing Bug https://svn.boost.org/trac10/ticket/4870 <p> boost::posix_time::from_iso_string() converts "20100713" into "20100713T201007.300000" which is obviously wrong. </p> <p> The error is caused by boost::date_time::split(). </p> <p> The attached patch corrects split() so that an exception is thrown later in parse_delimited_time_duration(). </p> <p> The problem is reproducible in Boost 1.42.0 and 1.44.0. </p> <p> This simple example demonstrates the issue: </p> <p> const boost::posix_time::ptime time=boost::posix_time::from_iso_string("20100713"); std::cout &lt;&lt; "Converted: " &lt;&lt; boost::posix_time::to_iso_string(time) &lt;&lt; std::endl; </p> <p> Converted: 20100713T201007.300000 </p> <p> Maybe someone can apply this patch. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4870 Trac 1.4.3 peter.klotz@… Fri, 19 Nov 2010 14:58:11 GMT attachment set https://svn.boost.org/trac10/ticket/4870 https://svn.boost.org/trac10/ticket/4870 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_1_42_0-DateTimeIsoParsingCheck.patch</span> </li> </ul> <p> Patch against Boost 1.42.0 </p> Ticket viboes Sat, 27 Nov 2010 14:29:22 GMT type changed https://svn.boost.org/trac10/ticket/4870#comment:1 https://svn.boost.org/trac10/ticket/4870#comment:1 <ul> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Patches</span> </li> </ul> Ticket Katie Chan Thu, 02 Dec 2010 06:41:28 GMT <link>https://svn.boost.org/trac10/ticket/4870#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4870#comment:2</guid> <description> <p> While the attached patch does work as expected, perhaps whether the resulting exception is the correct one should be considered. If not, that will need to be change as well. </p> <p> Also, the wider design issue of whether to actually check for correct input at all. If yes, what other incorrectly formatted input string would need to be consider and whether it's being correctly check currently. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Mon, 11 Apr 2011 18:20:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4870#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4870#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/71191" title="Applied patch; Refs #4870">[71191]</a>) Applied patch; Refs <a class="new ticket" href="https://svn.boost.org/trac10/ticket/4870" title="#4870: Patches: ISO Timestamp Parsing Bug (new)">#4870</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Mon, 11 Apr 2011 18:22:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4870#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4870#comment:4</guid> <description> <p> I've applied the patch - now let's talk about what else is needed to fix the problem. </p> <p> First - should we have a test case for this? </p> <p> Second - what is the desired behavior? </p> </description> <category>Ticket</category> </item> </channel> </rss>