I have a script where I have to establish an expiration month (ExpMM). It is currently defined as follows (format mm/dd/yyyy)
ExpMM worked fine, as long as the month being returned is 10, 11 or 12. The Month(now) is "02." Using the ExpMM=CurrentMonth+1, the month being returned is "3." In order for the script to work successfully, ExpMM must be returned as "03" (and "04" if Month(now) is 03, etc.)
What automation package and/or development language are you working in? Many modern languages have their own math functions for time/date values.
At an extreme you can check your return variable to see if it is 2 digit formatted, if not add a 0 to the beginning of it.