in reply to Roll your own date validation
Are you parsing the output of `date` to get your $month.
Fri Jan 9 15:25:55 IST 2004
As you can see the month part is not a 2 digit string .
You can put some check with the following logic
if($month < 10){$month=0.$month};
HTH