Re: [Boost-bugs] [Boost C++ Libraries] #9584: date_time::difference produces incorrect values

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9584: date_time::difference produces incorrect values
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-01-17 10:41:23


#9584: date_time::difference produces incorrect values
---------------------------------------------------+---------------------
  Reporter: Alexey Spiridonov <bstbg.20.lesha@…> | Owner: artyom
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: locale
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
---------------------------------------------------+---------------------

Comment (by anonymous):

 Sorry, my "expected output" was wrong. I'm going to assume that the sign
 is correct because the docs for ::difference() are unclear (is it
 subtracting this from other?).

 Then, I expect to see -25200 and -28800 (because the first timestamp is in
 daylight savings time, while the latter is not).

 The off-by-one error with difference() is pretty systematic, so maybe it's
 by design?

 Also, I tried to use that function to compute the difference in seconds
 across 40 years, and it returned garbage, so something probably
 overflowed.

 My current guess is that one should always prefer to subtract the results
 of calling the ::time() method instead of relying on ::difference().

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9584#comment:2>
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:15 UTC