If you use a set command to convert a month or day string to an arithmetic variable, the command will fail when the string is 08 or 09. To see this behavior, open a CMD prompt and type:
set mm=08
set /a mm=%mm%
or
set mm=09
set /a mm=%mm%
You will receive:
Invalid number. Numeric constants are either decimal (17),
hexadecimal (0x11), or octal (021).
To workaround this behavior, use the modulus operator:
set mm=08
set /a mm=100%mm%%%100
1 comment
Hide comments