Boost C++ Libraries: Ticket #12214: boost::posix_time::time_duration::sec_type is too small! https://svn.boost.org/trac10/ticket/12214 <p> This code: </p> <p> sec_type total_seconds() const { </p> <blockquote> <p> return static_cast&lt;sec_type&gt;(ticks() / ticks_per_second()); </p> </blockquote> <p> } </p> <p> is unsafe as sec_type is int32_t while ticks() is int64_t. </p> <p> See this post for an easy way to have inconsistent result when using boost::posix_time::time_duration::total_seconds(). </p> <p> sec_type should be enlarged to int64_t </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12214 Trac 1.4.3 anonymous Wed, 18 May 2016 12:37:38 GMT <link>https://svn.boost.org/trac10/ticket/12214#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12214#comment:1</guid> <description> <p> Forgot the link to "this post": <a class="ext-link" href="http://stackoverflow.com/questions/37299652/whats-wrong-with-boostposix-timetime-durationtotal-seconds"><span class="icon">​</span>http://stackoverflow.com/questions/37299652/whats-wrong-with-boostposix-timetime-durationtotal-seconds</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 15 Nov 2016 11:55:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12214#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12214#comment:2</guid> <description> <p> I met the same problem: <a class="ext-link" href="http://stackoverflow.com/questions/40590921/boost-timed-wait-doesnt-wait-if-date-is-in-2116-year"><span class="icon">​</span>http://stackoverflow.com/questions/40590921/boost-timed-wait-doesnt-wait-if-date-is-in-2116-year</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 15 Nov 2016 12:14:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12214#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12214#comment:3</guid> <description> <p> It looks like <strong>time_resolution_traits::v_type</strong> (boost/date_time/time_resolution_traits.hpp) should be changed to </p> <pre class="wiki">typename v_type = boost::int64_t </pre><p> for all the typedefs: day_type, hour_type, min_type, sec_type. </p> <p> At the moment it uses <strong>int32_t</strong>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Fri, 29 Dec 2017 02:29:28 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/12214#comment:4 https://svn.boost.org/trac10/ticket/12214#comment:4 <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> <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 Fri, 29 Dec 2017 02:30:10 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/12214#comment:5 https://svn.boost.org/trac10/ticket/12214#comment:5 <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">duplicate</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.66.0</span> </li> </ul> <p> See <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4543" title="#4543: Bugs: ptime: year 2038 problem (closed: fixed)">#4543</a>, fixed in 1.66.0 </p> <p> <a class="ext-link" href="https://github.com/boostorg/date_time/commit/818dea52f3f0c8b4f5172df13c5fa4f57340625f"><span class="icon">​</span>https://github.com/boostorg/date_time/commit/818dea52f3f0c8b4f5172df13c5fa4f57340625f</a> </p> Ticket