function TimeSpent($sec) {
$month = floor($sec / 2628000); $days = floor(($sec / 86400) - $month * 30); $hours = floor(($sec / 3600) - $days * 24); $minuts = floor(($sec - $hours * 3600 - $days * 86400) / 60); $seconds = $sec - ($minuts * 60 + $hours * 3600 + $days * 86400);
if ($month != 0) $month = $month.' мес ';
else $month = NULL;
if ($days != 0) $days = $days.' д ';
else $days = NULL;
if ($hours != 0) $hours = $hours.' ч ';
else $hours = NULL;
if ($minuts != 0) $minuts = $minuts.' м ';
else $minuts = NULL;
if ($seconds != 0)$seconds = $seconds.' с';
else $seconds = NULL;
if ($month != 0){
$month=$month.$days;
$days=NULL;
$hours = NULL;
$minuts = NULL;
$seconds = NULL;
}elseif ($days != 0){
$month=NULL;
$days=$days.$hours;
$hours = NULL;
$minuts = NULL;
$seconds = NULL;
}elseif ($days == 0 && $hours != 0){
$month=NULL;
$days = NULL;
$hours = $hours.$minuts;
$minuts = NULL;
$seconds = NULL;
}elseif ($hours == 0 && $minuts != 0){
$month=NULL;
$days = NULL;
$hours = NULL;
$minuts = $minuts.$seconds;
$seconds = NULL;
}elseif ($minuts == 0){
$month=NULL;
$days = NULL;
$hours = NULL;
$minuts = NULL;
$seconds = $seconds;
}
$sectoday = $month.$days.$hours.$minuts.$seconds;
return false;
}else{
return $sectoday;
}
}