By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!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
@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
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
Windows file age functions use 100ns ticks: ten-millionths of a second.The *60*60*24 is obvious but why the 10000000 ?
Windows file age functions use 100ns ticks: ten-millionths of a second.
Nanoseconds: FILETIME structurens = nanosecond? or was that supposed to be ms = miliseconds?
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