in reply to Zero-padding integers and the numbers-as-strings Red Flag

The typical way to handle this kind of string formatting is with sprintf:
$date_string = sprintf( "%2.2d-%2.2d-%d %2.2d:%2.2d:2.2d", $month, $day, $year, $hour, $min, $sec );
(Your explanation didn't mention seconds, but your code did, so I wrote the expression to produce "MM-DD-YYYY HH:MI:SS")

I think there's another way to assure padding with leading zeros, but the "%N.Nd" is what I grew up with from using C in olden times... The first digit (before the decimal point) represents the field width, and the second digit (after the decimal) represents "precision" (i.e. number of visible digits to output, using leading zeroes as needed); the "d" means make the result look like an integer value (as opposed to "f" for floating point, where "precision" would refer to the number of digits to the right of the decimal point, and field width would usually be larger than precision).