I've always found that when doing calcuations for things as in your example (eg. things older than x days) it can be easier to leave it in the time format of "seconds since the epoch". This way you can simply get your result by finding anything older than x days (times the number of seconds in those days eg "X" times 24 hours times 60 seconds times 60 seconds.
For example work got me to write a script to purge our share drive everyday of any files older than 7 days. Instead of adjusting times bewtween times formats I read the creation and modified dates for each file and simply compared them to a current time stamp. If the files mod time and creation time where both greater then 7*24*60*60 seconds I delete them.
Its easier to compute things to a base and then work from that base. Seconds is a good base.
If you have time in a mm/dd/yy format push this through the Time::Local() module of Perl to convert it back seconds. This module is the inverse of the localtime() function.
Also the Date::Calc module should blow your hair back as far as date calcuations go.
As for the leading zero try this:
#!perl
$var = 5;
$var = "0".$var if (length($var) < 2);
print $var;
Dean