TimeDiffDays

Returns the difference in days between the two dates.

Syntax:

TimeDiffDays (datetime1, datetime2)

Parameters:

(s) datetime1 uses format YYYY:MM:DD:HH:MM:SS, or YYYY:MM:DD

(s) datetime2 uses format YYYY:MM:DD:HH:MM:SS, or YYYY:MM:DD

Returns:

(i) integer the difference in days between the two dates.

 

Use this function to return the difference in days between two dates. Hours, mins, secs, if specified, are ignored.

"datetime1" must be the later (more recent) of the two times.

 

Example:


;Shopping days til Christmas
Now=TimeYmdHms( ) ; Get current time
Year=ItemExtract(1, Now, ":")
Xmas=StrCat(Year, ":12:25:00:00:00")
Shopping=TimeDiffDays(Xmas, Now)
If Shopping>0
   Message("Shopping Days to Christmas", Shopping)
Else
   If Shopping<0
      Message("You missed it by", Abs(Shopping))
   Else
      Message("Merry Christmas", "And a Happy New year")
   EndIf
EndIf
See Also:

FileTimeGet, FileTimeGetEx, TimeDate, TimeAdd, TimeYmdHms, TimeDiffSecs, TimeDelay, TimeWait