How to? date1 - date2 = number of days

#3
Here's a start. But the date formats will need to be standardized. @MAKEAGE has a second parameter that lets you specify one of seven date formats
Code:
v:\> function days `%@eval[(%@makeage[%2]-%@makeage[%1]) / (10000000*60*60*24)]`

v:\> echo %@days[2016-06-16,2016-08-11]
56

v:\> echo %@days[2016-06-16,2017-08-11]
421
 
#4
My first one was faulty. This is better and lets you use mm/dd/yy.
Code:
v:\> function days `%@eval[(%@makeage[%2,,1]-%@makeage[%1,,1]) / (10000000*60*60*24)]`

v:\> echo %@days[8/11/16,8/11/17]
365
 
#5
The VBScript DateDiff function is a solution that can be used with TCC;

Code:
@setlocal
@echo off
setdos /X-5
echo dtm1="01-Jan-16" > %@path[%_batchname]\dd.vbs
echo dtm2="%_Day-%_Monthf-%_Year" >> %@path[%_batchname]\dd.vbs
echo WScript.Echo "Difference between " & dtm1 & " and " & dtm2 >> %@path[%_batchname]\dd.vbs
echo intMonthsDifferent=DateDiff("d", dtm1, dtm2) >> %@path[%_batchname]\dd.vbs
echo WScript.Echo intMonthsDifferent >> %@path[%_batchname]\dd.vbs
setdos /X0
iff exist %@path[%_batchname]\dd.vbs then
  cscript //nologo %@path[%_batchname]\dd.vbs
  del /q %@path[%_batchname]\dd.vbs
else
  echo dd.btm - Error in creating %@path[%_batchname]\dd.vbs
endiff
endlocal
More info on the VBScript DateDiff function->: [title]

Joe
 
#10
Here's a start. But the date formats will need to be standardized. @MAKEAGE has a second parameter that lets you specify one of seven date formats
Code:
v:\> function days `%@eval[(%@makeage[%2]-%@makeage[%1]) / (10000000*60*60*24)]`

v:\> echo %@days[2016-06-16,2016-08-11]
56

v:\> echo %@days[2016-06-16,2017-08-11]
421
I like the function days above. How about similar functions xxx for function name

@xxx[date,days] = returns date that is + or - days from specified date