The following seems to produce the same results as the VBS "DateDiff" functions in limited testing but not entirely convinced that the "DataDiff" function is correct either.

;; Weeks between two dates.

#definefunction _TimeDiffWeeks( _Ymdhms1,_Ymdhms2)

nDays = TimeDiffDays(_Ymdhms2, _Ymdhms1)

nReturn = nDays/7

nRemainder = nDays mod 7

if nRemainder > 3 then nReturn +=1

else if nRemainder < -3 then nReturn -= 1

return nReturn

#endfunction

;; Whole months between two dates.

#definefunction _TimeDiffMonths( _Ymdhms1,_Ymdhms2)

nMonths = ItemExtract(1,_Ymdhms2,':') - ItemExtract(1,_Ymdhms1,':')

nMonths *= 12

nMonths += ItemExtract(2,_Ymdhms2,':') - ItemExtract(2,_Ymdhms1,':')

return nMonths

#endfunction

;; Whole years between two dates.

#definefunction _TimeDiffYears( _Ymdhms1,_Ymdhms2)

nYears = ItemExtract(1,_Ymdhms2,':') - ItemExtract(1,_Ymdhms1,':')

return nYears

#endfunction

d1="10/1/2017"

d2="9/30/2018"

d1=ObjectType('date', d1)

d2=ObjectType('date', d2)

;; Works ???

nWeeks = _TimeDiffWeeks(d1, d2)

nMonths = _TimeDiffMonths(d1, d2)

nYears = _TimeDiffYears(d1, d2)

strOut = $"Weeks %nWeeks%

Months %nMonths%

Years %nYears%

$"

Message('Date Spans', strOut)

Sept 25 - changed the _TimeDiffWeeks function a bit to handle negative weeks.