Subject: [Boost-bugs] [Boost C++ Libraries] #4543: ptime: year 2038 problem
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-16 16:06:50
#4543: ptime: year 2038 problem
--------------------------------------------+-------------------------------
Reporter: Roland Bock <rbock@â¦> | Owner: az_sw_dude
Type: Bugs | Status: new
Milestone: Boost 1.44.0 | Component: date_time
Version: Boost 1.44.0 | Severity: Problem
Keywords: |
--------------------------------------------+-------------------------------
At several locations in the code, the number of seconds, minutes, hours,
etc is explicitly limited to the value range of {{{long}}}, for instance
in {{{posix_time/conversion.hpp}}}:
{{{
inline
ptime from_time_t(std::time_t t)
{
ptime start(gregorian::date(1970,1,1));
return start + seconds(static_cast<long>(t));
}
}}}
As a result, for example -4260211200 is represented by some ptime in the
year 1971, but it should be 1835.
Or, in other words Boost.DateTime has the year 2038 problem.
Regards,
Roland
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4543> 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