[Boost-bugs] [Boost C++ Libraries] #4771: DST calculation inconsistencies

Subject: [Boost-bugs] [Boost C++ Libraries] #4771: DST calculation inconsistencies
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-22 15:46:11

#4771: DST calculation inconsistencies
 Reporter: mika.heiskanen@… | Owner: az_sw_dude
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
 One local_date_time constructor takes as argument a date and a time
 duration. However, its behaviour is not consistent. First, define a date
 prior to a DST change in the spring (one day prior is sufficient). Then
 assume you have to skip N minutes into the future, where N is large enough
 to get past the DST change.

 a) If you add floor(N/(24*60)) days to the date, and then construct a new
 local_date_time with the new date and N%(24*60) minutes, you get one

 b) If you construct a local_date_time with the original date and the N
 minutes (>24*60) you get a second result.

 The results are different by one hour for regular EU DST rules. It seems
 like the constructor will not inspect DST rules unless the input date
 coincides with the DST change date.

 The effect:

 Instead of looping with one origin time + advancing time_duration, we have
 to advance the date whenever the number of minutes exceeds 24*60 and take
 modulo 24*60 for the duration in minutes. This produces the correct
 behaviour for our application.

Ticket URL: <https://svn.boost.org/trac/boost/ticket/4771>
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