From e71f306c7d2e5aa2a90f71e0ac4c6aef60de98cb Mon Sep 17 00:00:00 2001 From: Naomi Date: Wed, 4 Dec 2013 15:24:27 -0500 Subject: [PATCH] CC-5594 : Remove all date_default_timezone_get() setting display time using user timezone. last played was never converted properly for display previously. --- airtime_mvc/application/models/StoredFile.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 6df223278..009572647 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -854,6 +854,13 @@ SQL; $row['utime'] = new DateTime($row['utime'], $utcTimezone); $row['utime']->setTimeZone($displayTimezone); $row['utime'] = $row['utime']->format('Y-m-d H:i:s'); + + //need to convert last played to localtime if it exists. + if (isset($row['lptime'])) { + $row['lptime'] = new DateTime($row['lptime'], $utcTimezone); + $row['lptime']->setTimeZone($displayTimezone); + $row['lptime'] = $row['lptime']->format('Y-m-d H:i:s'); + } // we need to initalize the checkbox and image row because we do not retrieve // any data from the db for these and datatables will complain