Returns the difference between two points in time.
TimeDiff( datetime1, datetime2)
(s) datetime1: valid datetime strings. (YMDHMS format)
(s) datetime2: valid datetime strings. (YMDHMS format)
(s) difference between the two times, in YmdHms format.
"datetime1" and "datetime2" must be valid date-time strings, in YmdHms format. "datetime1" must be the later (more recent) of the two times.
Because some months have more days than others, an adjustment may need to be made when converting the resulting "day" field into months. In the example:
TimeDiff("1998:09:30:00:00:00", "1998:08:31:00:00:00")
the result is, logically, "0000:00:30:00:00:00" (30 days).
But In this example:
TimeDiff("1998:10:01:00:00:00", "1998:08:31:00:00:00")
where the operation wraps past the End of the month, there is some question what the result should be, since there is NO such date as September 31. This function handles this by treating the period from August 31 To September 30 as one month, so the result would be "0000:01:01:00:00:00" (one month and one day).
;How long has it been since the beginning of the decade diff = TimeDiff(TimeYmdHms(), "2010:01:01:00:00:00") Message("How long since beginning of decade?",diff)
TimeDate, TimeAdd, TimeYmdHms, TimeDelay, TimeWait, FileTimeGet, FileTimeGetEx, TimeDiffDays, TimeDiffSecs