From d7d1170ee1643ed4a9fc54186596c5011abccb4b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 4 Mar 2013 18:52:51 -0500 Subject: [PATCH] CC-5003: Some tracks are being cut off before fully playout out -fixed --- airtime_mvc/application/common/DateHelper.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index cc02544cd..5d40e9b5f 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -229,7 +229,7 @@ class Application_Common_DateHelper public static function calculateLengthInSeconds($p_time){ if (2 !== substr_count($p_time, ":")){ - return FALSE; + return false; } if (1 === substr_count($p_time, ".")){ @@ -241,12 +241,8 @@ class Application_Common_DateHelper list($hours, $minutes, $seconds) = explode(":", $hhmmss); - // keep ms in 3 digits - $ms = substr($ms, 0, 3); - - $totalSeconds = $hours*3600 + $minutes*60 + $seconds + $ms/1000; - - return $totalSeconds; + $totalSeconds = ($hours*3600 + $minutes*60 + $seconds).".$ms"; + return round($totalSeconds, 3); } public static function ConvertToUtcDateTime($p_dateString, $timezone=null){