There is a bug in the code...

"$abbr[$mon] $mday";
Should be:
"$month_abbr[$mon] $mday";