you can remove the zero with a little trick:
set /a dd1=(1%dd: =0%-100)-1
This adds the string "1" to "08" (which is also still a string), resulting in "108". Then subtract "100" (/a
treating them as numbers), which results in "8". If in your locale the date has no leading zero but a space instead, %%d: =0%
replaces it with a zero
If you need the result with leading zero, just add it again:
set dd1=0%dd1%
set dd1=%dd1:~-2%
This adds the string "0" in front of the string "7" (result from before), resulting in "07" and takes the last two digits from it "07" (in case, the result from before is "24", -> add "0" = "024" -> last two = "24")
edited to work also in locales, where the date has a space instead of a leading zero. (thanks to L?u V?nh Phúc for spotting it)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…