[Gambas-user] BUG: Problem with DateAdd function

George gambas at ...2377...
Sat Feb 13 19:52:13 CET 2010


I've run into a strange problem with the DateAdd function, when trying 
to subtract from the current date by months.

I initially hit the problem with the following (values are hard-coded 
for clarity):
DateAdd(cdate("2/13/2010"),gb.month,-37)

It seems that any combination of Date and Interval that results in a 
date of January 2007 causes an "Invalid Date" error.  For example, the 
following are all invalid:
DateAdd(cdate("1/13/2010"),gb.month,-36)
DateAdd(cdate("2/28/2010"),gb.month,-37)
DateAdd(cdate("3/13/2010"),gb.month,-38)

Changing the starting date or the number of intervals so as to have a 
date that falls outside the month of January 2007 works okay.  It also 
works okay using periods of Year or Week that fall into those dates.

=======

System information:

Gambas Version 2.13
Components in project: gb.db, gb.db.form, gb.form, gb.gui, gb.settings, 
gb.vb

OS: Ubuntu 9.10 Karmic Koala; Kernel 2.6.31-19-generic-pae
GNOME 2.28.1

Hardware: Intel Core 2 Duo processor (E8400)




More information about the User mailing list