Boost C++ Libraries: Ticket #2818: boost::posix_time::from_time_t() assumes boost::int32_t == long https://svn.boost.org/trac10/ticket/2818 <p> boost::posix_time::from_time_t() uses a static_cast&lt;long&gt; to coerce the argument t to the appropriate type for the function seconds(), which expects a boost::int32_t. On an LP64 platform like MacOS 10.5, long is 64 bits, so this is incorrect and generates a warning about possible truncation. The corrected function should be: </p> <pre class="wiki"> //! Function that converts a time_t into a ptime. inline ptime from_time_t(std::time_t t) { ptime start(gregorian::date(1970,1,1)); return start + seconds(static_cast&lt;boost::int32_t&gt;(t)); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2818 Trac 1.4.3 anonymous Mon, 27 Mar 2017 22:25:52 GMT <link>https://svn.boost.org/trac10/ticket/2818#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2818#comment:1</guid> <description> <p> OMG, 8 years old! Any chance to be fixed in this decade? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 28 Mar 2017 16:20:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2818#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2818#comment:2</guid> <description> <p> There a fix for this in <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/4543"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/4543</a>. This can be closed as a duplicate of 4543, I believe. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Thu, 18 Jan 2018 14:18:54 GMT</pubDate> <title>owner, status, version, milestone changed https://svn.boost.org/trac10/ticket/2818#comment:3 https://svn.boost.org/trac10/ticket/2818#comment:3 <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> <li><strong>version</strong> <span class="trac-field-old">Boost Release Branch</span> → <span class="trac-field-new">Boost 1.38.0</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.39.0</span> → <span class="trac-field-new">Boost 1.67.0</span> </li> </ul> <p> Resolved as part of github issue 56: </p> <p> ​<a class="ext-link" href="https://github.com/boostorg/date_time/commit/de171954fe45e4d1338a641ebe70a84a181bd258#diff-c68588b074fe6450f9ed1dedc759621eR94"><span class="icon">​</span>https://github.com/boostorg/date_time/commit/de171954fe45e4d1338a641ebe70a84a181bd258#diff-c68588b074fe6450f9ed1dedc759621eR94</a> </p> Ticket James E. King, III Sun, 28 Jan 2018 16:22:35 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2818#comment:4 https://svn.boost.org/trac10/ticket/2818#comment:4 <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