TimeDiffSecs

Returns time difference in seconds between the two datetimes.

Syntax:

TimeDiffSecs(datetime1, datetime2)

Parameters:

(s) datetime1: format YYYY:MM:DD:HH:MM:SS.

(s) datetime2: format YYYY:MM:DD:HH:MM:SS.

Returns:

(i) difference in seconds between the two times.

 

Use this function to return the time difference between two datetimes. The time difference should not exceed 22000 days / 60 years or else an error will occur.

"datetime1" must be the later (more recent) of the two times, otherwise the result may be a negative value.

 

Example:


Now=TimeYmdHms( )
Midnight=StrCat(StrSub(Now,1,11), "00:00:00")
Seconds=TimeDiffSecs(Now, Midnight)
Message("Seconds since midnight", Seconds)
See Also:

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