Re: [Boost-bugs] [Boost C++ Libraries] #4543: ptime: year 2038 problem

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4543: ptime: year 2038 problem
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-11-14 15:09:51


#4543: ptime: year 2038 problem
------------------------------------+------------------------
  Reporter: Roland Bock <rbock@…> | Owner: az_sw_dude
      Type: Bugs | Status: assigned
 Milestone: | Component: date_time
   Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------+------------------------

Comment (by Jim King <jim.king@…>):

 Here are the changes I made. They are not yet in boost 1.60 but I believe
 they should be considered:

 {{{
 root_at_dvm5:/usr/local/src# diff
 boost_1_60_0_b1/boost/date_time/time_resolution_traits.hpp
 boost_1_59_0/boost/date_time/time_resolution_traits.hpp
 12c12
 <
 ---
> #include <ctime>
 71c71
 < typename var_type = boost::int32_t >
 ---
> typename var_type = std::time_t >
 }}}

 {{{
 root_at_dvm5:/usr/local/src# diff
 boost_1_60_0_b1/boost/date_time/posix_time/conversion.hpp
 boost_1_59_0/boost/date_time/posix_time/conversion.hpp
 12a13
> #include <boost/cstdint.hpp>
 24d24
 <
 29,30c29
 < ptime start(gregorian::date(1970,1,1));
 < return start + seconds(static_cast<long>(t));
 ---
> return ptime(gregorian::date(1970,1,1)) + seconds(t);
 35c34
 < std::time_t to_time_t(ptime pt)
 ---
> std::time_t to_time_t(const ptime& pt)
 37,38c36
 < time_duration dur = pt - ptime(gregorian::date(1970,1,1));
 < return std::time_t(dur.total_seconds());
 ---
> return (pt - ptime(gregorian::date(1970,1,1))).total_seconds();
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4543#comment:6>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC