From 1c642d5c55a9efafb69994c801d0273d0abbfc41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Frank=20J=2E=20G=C3=B3mez?= Date: Tue, 16 Jan 2018 19:34:54 -0500 Subject: [PATCH] CRM-21667: Fixed timezone handoff from Drupal6. --- CRM/Utils/System/Drupal6.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index aae0fbfe16..721855e111 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -758,9 +758,18 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { else { $timezone = variable_get('date_default_timezone', NULL); } + + // Retrieved timezone will be represented as GMT offset in seconds but, according + // to the doc for the overridden method, ought to be returned as a region string + // (e.g., America/Havana). + if (strlen($timezone)) { + $timezone = timezone_name_from_abbr("", (int) $timezone, 0); + } + if (!$timezone) { $timezone = parent::getTimeZoneString(); } + return $timezone; } -- 2.25.1