Posting time bug fix proposal

Christian Stimming stimming at tuhh.de
Thu Jul 24 03:03:44 EDT 2008


Am Mittwoch, 23. Juli 2008 20:29 schrieb Charles Day:
> Leaving aside the talk of new features, I would like to propose an initial
> set of changes that will squash the current bug caused by a change to the
> OS timezone without introducing any new features. New features can be added
> later on of course.
>
> The goals are:
> -Prevent changes to the OS time zone from causing GnuCash problems.
> -Leave the file format syntactically unchanged.
> -Leave the file format backwards compatible.
> -Leave the door open for future time entry features by continuing to use
> timestamps internally.

Looks very good to me! Thanks a lot.

Regards,

Christian

>
> Here's how I propose this would work:
> 1. For backward compatibility, the current posting date format of
> "YYYY-MM-DD HH:MM:SS" followed by the current OS timezone at write time
> would not change.
> 2. When reading each transaction from a file, if the "HH:MM:SS" part is
> equal to "00:00:00" then the transaction is not bug affected and the
> YYYY-MM-DD part contains the date the originally entered in the register.
> 3. When reading a file, if the "HH:MM:SS" part is NOT equal to "00:00:00"
> then the transaction is bug affected and must be reviewed to determine the
> date the user originally entered in the register can be determined. In some
> cases GnuCash would need to ask the user some questions to determine how to
> do the adjustment, but in most cases I suspect it would not. (I won't go
> into the algorithm for the moment.)
> 3. Once the date originally entered in the register has been determined,
> GnuCash converts that date into a timestamp by imposing a default time of
> day of 12:00 (the actual time doesn't matter as long as it is fixed) and a
> fixed time zone of UTC.
> 4. Now that the file has been loaded, the user does whatever they want in
> the GUI, completely unaware of what time of day or time zone GnuCash is
> using internally.
> 5. When the file is saved, GnuCash converts the timestamp back into the
> originally entered date (which it can do because the time of day and time
> zone are fixed at 12:00 and UTC on all transactions).
> 6. GnuCash saves in the format "YYYY-MM-DD 00:00:00", followed by the
> current, OS-determined local time zone. The YYYY-MM-DD part contains is the
> originally entered date, .
>
> Unless I have miscalculated, this meets the four goals stated above.
>
> Comments?
>
> Cheers,
> Charles
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel


More information about the gnucash-devel mailing list