summaryrefslogtreecommitdiff
path: root/libs/system.php
diff options
context:
space:
mode:
authorShevAbam <shevabam@gmail.com>2015-07-16 15:24:17 +0200
committerShevAbam <shevabam@gmail.com>2015-07-16 15:24:17 +0200
commitc384224e0a0dbea61745595a2cb63664b6d2fd84 (patch)
tree2964a0f3d27af9242cad18a9d6f744686267fde6 /libs/system.php
parenta935f5ece1d4b3738ad7b085d8dfebfbfc04cef0 (diff)
Uptime : more readable
Diffstat (limited to 'libs/system.php')
-rw-r--r--libs/system.php17
1 files changed, 1 insertions, 16 deletions
diff --git a/libs/system.php b/libs/system.php
index 015b1dd..39e4096 100644
--- a/libs/system.php
+++ b/libs/system.php
@@ -31,22 +31,7 @@ if (!($totalSeconds = shell_exec('/usr/bin/cut -d. -f1 /proc/uptime')))
}
else
{
- $totalMin = $totalSeconds / 60;
- $totalHours = $totalMin / 60;
-
- $days = floor($totalHours / 24);
- $hours = floor($totalHours - ($days * 24));
- $min = floor($totalMin - ($days * 60 * 24) - ($hours * 60));
-
- $uptime = '';
- if ($days != 0)
- $uptime .= $days.' day'.Misc::pluralize($days).' ';
-
- if ($hours != 0)
- $uptime .= $hours.' hour'.Misc::pluralize($hours).' ';
-
- if ($min != 0)
- $uptime .= $min.' minute'.Misc::pluralize($min);
+ $uptime = Misc::getHumanTime($totalSeconds);
}
// Last boot