Posting time bug fix proposal

Charles Day cedayiv at gmail.com
Wed Jul 23 14:29:04 EDT 2008


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.

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


More information about the gnucash-devel mailing list