Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3487: using 32bit seconds type in boost::posix_time::time_duration is leading to year 2038 problem
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-11-22 10:59:05
#3487: using 32bit seconds type in boost::posix_time::time_duration is leading to
year 2038 problem
------------------------------------------------------+---------------------
Reporter: Meike Schmidt <mschmidt.trittau@â¦> | Owner: az_sw_dude
Type: Bugs | Status: new
Milestone: Boost-1.46.0 | Component: date_time
Version: Boost 1.46.0 | Severity: Showstopper
Resolution: | Keywords:
------------------------------------------------------+---------------------
Changes (by anonymous):
* version: Boost 1.40.0 => Boost 1.46.0
* severity: Problem => Showstopper
* milestone: Boost 1.41.0 => Boost-1.46.0
Comment:
I just stumbled over the same thing when trying to use a
boost::posix_time::microseconds() which during the way to a 64bit value
will be garbled by calculations around time_resolution_traits because the
integer argument is int32_t per default.
I would recommend that you take from the first traits parameter (that is
used with the structs time_resolution_traits_adapted64_impl) in
date_time/time_resolution_traits.hpp class time_resolution traits instead
of
typename v_type = boost::int32_t
you better use
typename v_type = typename frac_sec_type::int_type
since in the end the _res structs are correctly defined as
typedef time_resolution_traits<time_resolution_traits_adapted64_impl,
nano, 1000000000, 9 > nano_res;
which would make the 64bit value properly appear.
Otherwise this all is unusable for us since we work with microseconds and
nonoseconds since epoch timestamps on wire.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3487#comment:1> 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:04 UTC