CRM-17072 fix timezone handling for UTF dates
authoreileenmcnaugton <eileen@fuzion.co.nz>
Mon, 24 Aug 2015 00:09:06 +0000 (12:09 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Mon, 24 Aug 2015 00:11:06 +0000 (12:11 +1200)
CRM/Utils/System/Base.php

index 866aeeafed11b172cbb36a1179a544dc58fab961..0e076d3126814b230e908b558ec82d00a268e834 100644 (file)
@@ -548,6 +548,10 @@ abstract class CRM_Utils_System_Base {
   public function getTimeZoneOffset() {
     $timezone = $this->getTimeZoneString();
     if ($timezone) {
+      if ($timezone == 'UTC') {
+        // CRM-17072 Let's short-circuit all the zero handling & return it here!
+        return '+00:00';
+      }
       $tzObj = new DateTimeZone($timezone);
       $dateTime = new DateTime("now", $tzObj);
       $tz = $tzObj->getOffset($dateTime);