gnc-date.c - erroneous leap year calculations.

Neil Williams linux at
Sun Feb 6 16:45:39 EST 2005

On Sunday 06 February 2005 8:57 pm, you wrote:
> Applied to 1.8 and HEAD.  Thanks for noticing.  This should make
> the 1.8.11 cutoff (the last thing.. Phew.  Thanks Chris!).

Hehe, that'll make it the first bit of code I've changed to get into the main 

> I wonder 
> how nobody noticed this issue ever before?
> -derek

If it had been more common, it would have been spotted ages ago. According to 
the GnuCash CVS, it's used / instead of % since v1.53 of the predecessor, 
date.c, nearly 3 years ago when the function was first introduced. (Great 
thing the Attic!)

AFAICT, it's only used in GncBillTerm.c under the guise of 
gnc_timespec_last_mday, in the  compute_monthyear function with 
Definition at line 583 of file gncBillTerm.c. 
(info courtesy of a tweaked Doxygen config that uses referenced by:)

So compute_time(),  gncBillTermComputeDiscountDate(), and 
gncBillTermComputeDueDate() would only be affected if 
GNC_TERM_TYPE_PROXIMO was set. It cascades out as far as
gnc_dialog_date_close_ok_cb and dialog-date-close.c, 
gnc_order_window_close_order_cb and gnc_order_new_window.

That was until today when I needed to use it to calculate the last day of the 
month in pilot-link so that I could raise an easy query for all objects with 
dates within one whole month.

Presumably the reports and scheme use a different method? I can't find any 
references to it.


Neil Williams

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the gnucash-patches mailing list