Another (very minor) stylistic point: you can use sprintf to good effect and avoid having to set up a temporary array.
in reply to If/else problems
Not to worry though, if you're comfortable with your method (TIMTOWTDI, after all).
my $timediff=0; # set it to whatever
# just get the month
my $month = (localtime(time + ($timediff * 3600)));
# move 0..11 month range into line with human convention
$month = sprintf("%02d", ++$month);
Update: simplified to better make the point.