|Test this. It is assumed that the second date will always be greater than the first, if not then you should code a routine to check this and branch to a suitable routine.|
set /a daydiff=%juldate1%-%juldate%
echo Difference=%daydiff% days.
:: Convert Gregorian date to Julian date
:: Algorithm based on Fliegel-Van Flandern
:: algorithm from the Astronomical Almanac,
:: provided by Doctor Fenton on the Math Forum
:: and converted to batch code by Ron Bakowski.
SET /A Month1 = ( %MM% - 14 ) / 12
SET /A Year1 = %year% + 4800
SET /A jdate = 1461 * ( %Year1% + %Month1% ) / 4 + 367 * ^
( %MM% - 2 -12 * %Month1% ) / 12 - ( 3 * ( ( %Year1% + %Month1% + 100 ) / ^
100 ) ) / 4 + ^%DD% - 32075
Please come back & tell us if your problem is resolved.