Master on Windows 10

John Ralls jralls at ceridwen.us
Mon May 2 13:34:52 EDT 2016


> On May 2, 2016, at 9:57 AM, Geert Janssens <geert.gnucash at kobaltwit.be> wrote:
> 
> On Monday 02 May 2016 17:31:36 Robert Fewell wrote:
> > Just checked all four systems, both Linux systems are Gentoo based
> > with a timezone of 'Europe/London', used date +'%:z %Z' which
> > returned +01:00 BST for both.
> > 
> > XP VM has time zone of '(GMT) Casablanca' with DST ticked and
> > Windows10 is '(UTC) Dublin, Edinburgh, Lisbon, London' with DST
> > ticked. All systems synced to a NTP clock.
> > 
> > So there appears to be a discrepancy between Linux and windows stored
> > date-times unless I am confused ?
> > 
> > Robert
> > 
> > On 2 May 2016 at 16:11, John Ralls <jralls at ceridwen.us> wrote:
> > > > On May 2, 2016, at 6:33 AM, Robert Fewell <14ubobit at gmail.com>
> > > > wrote:
> > > > 
> > > > John,
> > > > 
> > > > I think I have found the problem, well may be the start, in
> > > 
> > > gnc-timezone.cpp on line 230, I think it should be max_year instead
> > > of 0.> 
> > > > If I change that, then Gnucash starts up but I think some thing
> > > > else is> 
> > > wrong also. If I create a new file with two transactions, one today
> > > and one 02/03/2016 before BST, they are stored in the xml files as
> > > follows, all entered between 13:00 and 14:00 local time...
> > > 
> > > > XFCE, Gnucash 2.6.11
> > > > 
> > > > date posted  2016-03-02 00:00:00 +0000
> > > > date entered 2016-05-02 13:31:39 +0100
> > > > 
> > > > date posted  2016-05-02 00:00:00 +0100
> > > > date entered 2016-05-02 13:31:24 +0100
> > > > 
> > > > Gnome VM, Gnucash Master
> > > > 
> > > > date posted  2016-03-02 00:00:00 +0000
> > > > date entered 2016-05-02 13:24:39 +0100
> > > > 
> > > > date posted  2016-05-02 00:00:00 +0100
> > > > date entered 2016-05-02 13:24:39 +0100
> > > > 
> > > > Win10, Gnucash Master
> > > > 
> > > > date posted  2016-03-02 00:00:00 -0100
> > > > date entered 2016-05-02 12:45:55 +0000
> > > > 
> > > > date posted  2016-05-02 00:00:00 +0000
> > > > date entered 2016-05-02 12:45:39 +0000
> > > > 
> > > > WinXP VM, Gnucash Master
> > > > 
> > > > date posted  2016-03-02 00:00:00 -0100
> > > > date entered 2016-05-02 12:55:46 +0000
> > > > 
> > > > date posted  2016-05-02 00:00:00 +0000
> > > > date entered 2016-05-02 12:55:32 +0000
> > > > 
> > > > Just looking for confirmation before I start looking further.
> > > 
> > > Robert,
> > > 
> > > Yes, I think you're right about line 230.
> > > 
> > > As for the stored date-times, are the timezones the same on the
> > > various systems and VMs? Looks like it's -1/0 (standard/summer,
> > > relative to UTC) on Windows and 0/+1 on Linux.
> > > 
> Perhaps our windows build (which depends on mingw) isn't picking up daylight saving time information from the windows time configuration.
>  
> I ran into this problem with MSYS also:
> http://stackoverflow.com/questions/2563044/changing-timezone-in-msys/4016076#4016076

No, it's picking up DST: Notice that the TZ for the posted date on 2016-03-02 is -0100 and for 2016-0502 is +0000. What it's doing is miscalculating the TZ by an hour on Windows. The line 
   duration std_off (0, regtzi.StandardBias - regtzi.Bias, 0);
isn't quite right because regtzi.Bias (a.k.a the Bias element of the TIME_ZONE_INFORMATION struct) changes with DST. When in DST it needs an additional correction with regtzi.DaylightBias to obtain the standard offset. It's a harmless bug, the times are correctly recorded since they correctly reflect the UTC time, they just look weird because the timezone is off.

A separate issue, though: I thought I'd moved the transaction recording time to be 1300Z from midnight local. Obviously not.

Regards,
John Ralls




More information about the gnucash-devel mailing list