Jump to content

displaying time format


etrader

Recommended Posts

I used the following code to convert the length in seconds to min:second format

$sec=$duration % 60;
if ($sec=="0"){
$min=$duration/60;
$duration=''.$min.':00';
}else{
$min=(($duration-$sec)/60);
$duration=''.$min.':'.$sec.'';
}

everything is OK, but it shows 35:5 instead of 35:05. I mean it disregards the first 0 when the second is 1-digit.  :-\

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.