diff options
author | stilez <stilez@users.noreply.github.com> | 2016-05-31 07:23:54 +0100 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-06-22 11:23:24 -0400 |
commit | 3bea132198b1a6139f25e9e2feb298b04cb8a502 (patch) | |
tree | f43586c05f6a871ce83f80631a8145d20c0a2e61 /src | |
parent | d65d58a794e3016f363af2920e31fb2d2aa86484 (diff) | |
download | pfsense-3bea132198b1a6139f25e9e2feb298b04cb8a502.zip pfsense-3bea132198b1a6139f25e9e2feb298b04cb8a502.tar.gz |
optional arg for old behaviour
(cherry picked from commit cf63f1638aab685cc956502f5ddd862a10bf3ff8)
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index fb9f43d..e62ac43 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -1144,13 +1144,14 @@ function is_pppoe_server_enabled() { return $pppoeenable; } -function convert_seconds_to_dhms($sec) { +/* Optional arg forces hh:mm:ss without days */ +function convert_seconds_to_dhms($sec, $showhoursonly = false) { if (!is_numericint($sec)) { return '-'; } // FIXME: When we move to PHP 7 we can use "intdiv($sec % X, Y)" etc - list($d, $h, $m, $s) = array( (int)($sec/86400), - (int)(($sec % 86400)/3600), + list($d, $h, $m, $s) = array( (int)($showhoursonly ? 0 : $sec/86400), + (int)($showhoursonly ? $sec : $sec % 86400)/3600), (int)(($sec % 3600)/60), $sec % 60 ); |