who cand edit this function
to work to show only second fi the time is unde 1 min ...and the week , and month ....tried 2 do that but fall
Code:
function gettimemsg($sec)
{
$days=0;
$mins=0;
$hours=0;
if ($sec>59)
{
$secs=$sec%60;
$mins=$sec/60;
$mins=(integer)$mins;
}
if ($mins>60)
{
$hours=$mins/60;
$hours=(integer)$hours;
$mins=$mins%60;
}
if ($hours>24)
{
$days=$hours/24;
$days=(integer)$days;
$hours=$hours%24;
}
if($days>0)
{
return "$days days, $hours hours, $mins mins, $secs secs";
}
if($days<1)
{
if($hours>0)
{
return "$hours hours, $mins mins, $secs secs";
}
if($hours<1)
{
return "$mins mins, $secs secs";
}
}
}

Comment