From 8986f1bc4f9e4d50e9695bc7d86bcc0ae6b1880c Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 12 Dec 2013 11:32:40 -0500 Subject: [PATCH] CC-5627 : Check all Application_Common_DateHelper calculations that use timezone. * Changed getRangeStartAndEnd() to use UTC explictly --- airtime_mvc/application/models/Schedule.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index d10f8e435..172c9da41 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -858,16 +858,18 @@ SQL; { $CC_CONFIG = Config::getConfig(); + $scheduleTimeZone = new DateTimeZone('UTC'); + /* if $p_fromDateTime and $p_toDateTime function parameters are null, then set range * from "now" to "now + 24 hours". */ if (is_null($p_fromDateTime)) { - $t1 = new DateTime("@".time()); + $t1 = new DateTime("@".time(), $scheduleTimeZone); $range_start = $t1->format("Y-m-d H:i:s"); } else { $range_start = Application_Model_Schedule::PypoTimeToAirtimeTime($p_fromDateTime); } if (is_null($p_fromDateTime)) { - $t2 = new DateTime("@".time()); + $t2 = new DateTime("@".time(), $scheduleTimeZone); $cache_ahead_hours = $CC_CONFIG["cache_ahead_hours"];