summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/config.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r--frontends/php/include/config.inc.php31
1 files changed, 30 insertions, 1 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index b4bc5364..75ce2fb2 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -170,6 +170,35 @@ function SDI($msg="SDI") { echo "DEBUG INFO: "; if(is_array($msg)) print_r($msg)
$ret=date("Y.m.d H:i:s",$value);
return $ret;
}
+//Special processing of uptime
+ if($units=="uptime")
+ {
+ $ret="";
+ $days=floor($value/(24*3600));
+ if($days>0)
+ {
+ $value=$value-$days*(24*3600);
+ }
+ $hours=floor($value/(3600));
+ if($hours>0)
+ {
+ $value=$value-$hours*3600;
+ }
+ $min=floor($value/(60));
+ if($min>0)
+ {
+ $value=$value-$min*(60);
+ }
+ if($days==0)
+ {
+ $ret = sprintf("%02d:%02d:%02d", $hours, $min, $value);
+ }
+ else
+ {
+ $ret = sprintf("%d days, %02d:%02d:%02d", $days, $hours, $min, $value);
+ }
+ return $ret;
+ }
// Special processing for seconds
if($units=="s")
{
@@ -205,7 +234,7 @@ function SDI($msg="SDI") { echo "DEBUG INFO: "; if(is_array($msg)) print_r($msg)
$ret=$ret.$t."m";
$value=$value-$t*(60);
}
- $ret=$ret.$value."s";
+ $ret=$ret.round($value)."s";
return $ret;
}