|Edit:Some clarification / fixes.|
All you have to do about the octal is prefix a "1" subtract and it later.
You can't really trust the date variable, but anyway....
Your logic also doesn't account for the 29th,30th and 31st not being available in certain months.
dd mm yyyy - dd mm yyyy (not available)
29 01 2010 - 29 02 2010
30 01 2010 - 30 02 2010
31 01 2010 - 31 02 2010
It will be a very common problem in fact:
January -> February
March -> April
May -> June
August -> September
October -> November
All could fall from the same issue and it is still the same below. I'm not sure of how you would even want to deal with it (roll over again to the first? Use the last day?).
set /a m=1%m% + 1
if %m% gtr 112 (
set /a y+=1
) else set m=%m:~1%