From 1b0438dd8f6c51adb7dba2f3f8366a67f5f00b92 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 15 Oct 2018 15:46:27 -0600 Subject: [PATCH] Update functions.php --- resources/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/functions.php b/resources/functions.php index 17c9ae39e1..1ccf6dc590 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -850,6 +850,16 @@ function format_string ($format, $data) { return $phone_number; } +//format seconds into hh:mm:ss + function format_hours($seconds) { + $hours = floor($seconds / 3600); + $minutes = floor(($seconds / 60) % 60); + $seconds = $seconds % 60; + if (strlen($minutes) == 1) { $minutes = '0'.$minutes; } + if (strlen($seconds) == 1) { $seconds = '0'.$seconds; } + return "$hours:$minutes:$seconds"; + } + //browser detection without browscap.ini dependency function http_user_agent($info = '') { $u_agent = $_SERVER['HTTP_USER_AGENT'];