Boost C++ Libraries: Ticket #604: from_ftime incorrectly processes FILETIME filled with zeros https://svn.boost.org/trac10/ticket/604 <pre class="wiki">using namespace boost::posix_time; using namespace boost::gregorian; FILETIME ft; ZeroMemory( &amp;ft, sizeof( ft ) ); ptime pt = from_ftime&lt;ptime&gt;( ft ); if ( pt.is_special() ) { // Never fall into this branch! std::cout &lt;&lt; "ERROR"; } else { // Exception: boost::gregorian::bad_year std::cout &lt;&lt; boost::format("%1%") % pt.date().year(); } I suppose that when FILETIME is filled with zeroes, from_ftime() should return not_a_date_time. But it does not do this. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/604 Trac 1.4.3 quatras Mon, 19 Jun 2006 18:34:08 GMT <link>https://svn.boost.org/trac10/ticket/604#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/604#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=994937 Note that a FILETIME of all binary zeros corresponds to the time 1601-01-01 00:00:00.00000 GMT. This is not really an error, since it is a valid FILETIME, and is the beginning of the FILETIME time-epoch. MS defines a FILETIME as a positive (non-negative) offset from that epoch, and only a negative value is really an error. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Thu, 04 Jun 2009 08:45:37 GMT</pubDate> <title>status, resolution changed; severity set https://svn.boost.org/trac10/ticket/604#comment:2 https://svn.boost.org/trac10/ticket/604#comment:2 <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-old">None</span> → <span class="trac-field-new">wontfix</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Showstopper</span> </li> </ul> <p> Zero FILETIME is valid, so there's no reason to convert it to not_a_date_time. </p> Ticket