mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-04 02:04:53 +02:00
timeElapsed
This commit is contained in:
parent
f62f07d102
commit
92eee8245d
1 changed files with 18 additions and 0 deletions
|
@ -56,6 +56,24 @@ class Lang
|
|||
return date($config['date_format'] . ' H:i', strtotime("$date $time"));
|
||||
}
|
||||
|
||||
public static function timeElapsed($time){
|
||||
$s = $time%60;
|
||||
$m = floor(($time%3600)/60);
|
||||
$h = floor(($time%86400)/3600);
|
||||
$d = floor(($time%2592000)/86400);
|
||||
$M = floor($time/2592000);
|
||||
$result = '';
|
||||
if($M>0){
|
||||
$result = $M.'m ';
|
||||
}
|
||||
if($d>0){
|
||||
$result .= $d.'d ';
|
||||
}else if($M>0){
|
||||
$result .= '0d ';
|
||||
}
|
||||
return "$result$h:$m:$s";
|
||||
}
|
||||
|
||||
public static function nl2br($text)
|
||||
{
|
||||
return nl2br($text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue