DateDiff

STATIC FUNCTION DateDiff ( period AS String, Date1 AS Date, Date2 AS Date ) AS Integer

Returns the number of periods between two dates A negative number will mean that date2 is bigger than date1.

Period is a string expression that is the interval to be returned.

Period Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday - Note: A Weekday is Monday to Friday in Gambas. This is different to VB in which w = d
ww Week
h Hour
n Minute
s Second

Date1 and Date2 are the two dates or literals representing dates from which the difference is calculated. Date1 is subtracted from Date2 (which is currently the opposite to VB! :-).