Re: [Boost-bugs] [Boost C++ Libraries] #6045: Date/Time: dst_calculator::local_is_dst doesn't deal with DST changeover at end of day

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6045: Date/Time: dst_calculator::local_is_dst doesn't deal with DST changeover at end of day
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-03 15:07:36


#6045: Date/Time: dst_calculator::local_is_dst doesn't deal with DST changeover at
end of day
--------------------------------------+------------------------
  Reporter: Matt Adam <matt.adam@…> | Owner: az_sw_dude
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: date_time
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+------------------------

Comment (by jpettiss@…):

 DST ended at midnight in Brazil this year on February 22nd. For this
 timezone, `dst_local_end_time()` returns the correct value, but a
 `local_date_time` constructed from time_t in that timezone returns true
 for `is_dst()` for up to an hour after that point. This is due to the
 logic in `dst_calculator::local_is_dst()` assuming that if the date is
 different, then no time distance calculations have to be performed. In
 this timezone, 2015/02/21 23:30:00 labels two different points, one which
 happens before the DST change, one which happens after.

 {{{
   time_zone_ptr tz(new posix_time_zone("BRT3BRST,M10.3.0/0,M2.5.0/0"));
 //America/Sao_Paulo
   ptime pt = from_time_t( -1 + (time_t)tz->dst_local_end_time() );
   assert( local_date_time(pt, tz).is_dst() ); //dst has not ended yet
   pt = from_time_t( 1 + (time_t)tz->dst_local_end_time() );
   assert( !local_date_time(pt, tz).is_dst() ); //fails
   pt = from_time_t( 3600 + (time_t)tz->dst_local_end_time() );
   assert( !local_date_time(pt, tz).is_dst() ); //dst has ended
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6045#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:18 UTC