how would you (in vbscript) compare times like this:
if (time1 - time2) > 60minutes then
code code code code code code code
end if
so basically i want to do something only if the 2 times are less then 1 hour apart.
thanks in advance for any help.
Printable View
how would you (in vbscript) compare times like this:
if (time1 - time2) > 60minutes then
code code code code code code code
end if
so basically i want to do something only if the 2 times are less then 1 hour apart.
thanks in advance for any help.
You could use the DateDiff() function with a minutes ("n") interval like so:
PaulCode:If DateDiff("n", datetime1, datetime2) < 60 Then
' Do your code here.
End if
PS - Edited to change 'minuetes' to 'minutes' - geez. :P
[Edited by PWNettle on 12-12-2000 at 06:08 PM]
thanks! worked perfectly!