Control: reassign -1 libboost-date-time1.62.0 1.62.0+dfsg-6 Control: retitle -1 boost::date_time is wrong near DST change Control: notforwarded -1 Control: affects -1 gnucash
According to https://bugs.gnucash.org/show_bug.cgi?id=796747#c6 the following issue in GnuCash comes from a bug in boost::date_time (FYI, before 3.x, gnucash wasn't using boost). Quoting the reply in the GnuCash bug report: Hmm, you're right. It's applying what it thinks is the offset for the date for your current timezone. 2012-03-25 00:59:59 UTC was the change-second from standard to daylight time, so the offset for times after 01:00:00 (as in your examples) should be +2:00. 2017-10-29 00:59:59 UTC was similarly the change back to standard time for that year, so times before that should also be +2:00. The conversion is apparently mis-applying the summer time offset on the transition days. That would be a bug in boost::date_time; our formatter uses its operator<<. On 2018-07-09 00:37:37 +0200, Vincent Lefevre wrote: > After the upgrade to gnucash 3.x (well, I assume this is the cause), > some dates in the .gnc file have changed incorrectly. For instance: > > <trn:date-entered> > - <ts:date>2012-03-25 03:47:47 +0200</ts:date> > + <ts:date>2012-03-25 02:47:47 +0100</ts:date> > </trn:date-entered> > > <trn:date-entered> > - <ts:date>2012-03-25 03:50:40 +0200</ts:date> > + <ts:date>2012-03-25 02:50:40 +0100</ts:date> > </trn:date-entered> > > <trn:date-entered> > - <ts:date>2012-03-25 03:51:02 +0200</ts:date> > + <ts:date>2012-03-25 02:51:02 +0100</ts:date> > </trn:date-entered> > > <trn:date-entered> > - <ts:date>2012-03-25 03:48:15 +0200</ts:date> > + <ts:date>2012-03-25 02:48:15 +0100</ts:date> > </trn:date-entered> > > <trn:date-entered> > - <ts:date>2017-10-29 02:53:42 +0200</ts:date> > + <ts:date>2017-10-29 01:53:42 +0100</ts:date> > </trn:date-entered> > > <trn:date-entered> > - <ts:date>2017-10-29 02:53:54 +0200</ts:date> > + <ts:date>2017-10-29 01:53:54 +0100</ts:date> > </trn:date-entered> > > The dates are equivalent in term of UTC times, but the timezones > silently became incorrect. > > These entries were entered with the Europe/Paris timezone. But: > > $ TZ=Europe/Paris date +'%F %T %z' -d '2012-03-25 02:47:47 +0100' > 2012-03-25 03:47:47 +0200 > > So, 2012-03-25 03:47:47 +0200 was really the correct local date+time, > not 2012-03-25 02:47:47 +0100. The consequences of this bug are eventually minor in GnuCash, but may be more severe in other applications. -- Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

