Posting time bug fix proposal (simplified)

Derek Atkins warlord at MIT.EDU
Sat Aug 16 11:04:13 EDT 2008

"Charles Day" <cedayiv at> writes:

>     How does this patch handle the (non-default) time used in the
>     book closing transactions?
> I was not aware of this issue. My patch doesn't change the backend's file
> writing code, so whatever timestamp is assigned by GnuCash is what gets saved.
> If the time written isn't midnight, the patch will think that the transaction
> is bug-affected when the file is read in again.
> Could you explain about the time used in book closing transactions? I had
> hoped to avoid changing the file writing part of the code, but maybe that's
> not possible.

See src/gnome-utils/dialog-date-close.c

First, there is an assumption that we're using a time_t:

  bal = xaccAccountGetBalanceAsOfDate(a, cacb->cbw->close_date+1);

However, the close_date is set 12 hours ahead of the default:

    cbw->close_date = gnc_date_edit_get_date(GNC_DATE_EDIT(cbw->close_date_widge
    cbw->close_date += (3600 * 12);  /* Add 12 hours to the timestamp */

As the default is currently midnight this is generally always safe
in the current environment.

However, the closing transaction needs to be the "last" transaction
of the day.


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available

More information about the gnucash-devel mailing list