Home > comp > gb.vb > vb > datediff 
  [3.0]
 fr de es it nl pl pt pt_BR mk sq ca ar fa vi ja ru zh zh_TW eo
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration  
Documentation
History
 
Vb.DateDiff (gb.vb)
Syntax
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 Week day - Note: A week day 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! :-).