esatto,

codice:
return sprintf("%02d:%02d", $hr,$min) . $ampm;
grazie