I am trying to write a function to convert seconds to time format (hh:mm AM/PM)
function convertsecs ( $mysec )
$timesec = bcmod($mysec,60);
$timemin = bcmod(($mysec - $timesec),3600) / 60;
$timehour = ($mysec - ($timemin*60)) / 3600;
$newtime = date("h m", mktime($timehour,$timemin));
Is this right? If not what am I doing wrong?