A number preceded by 0 in bash is interpreted as an octal number (see the Advanced Bash Scripting Guide, chapter 8.2
). So the base is too high for the integer comparison. You can avoid the leading zero using one of the following
in this way the day of the month is padded with spaces and the arithmetic operator returns a decimal numerical constant.