From 2691593075b7e5bdafe835ff5b1a07894767b856 Mon Sep 17 00:00:00 2001 From: "Matthew Wire (MJW Consulting)" Date: Wed, 1 Aug 2018 10:39:18 +0100 Subject: [PATCH] Make sure Joomla timezone is set for cron jobs --- CRM/Utils/System/Joomla.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 2b8ec1a31a..64bb31d778 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -589,6 +589,14 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { define('JDEBUG', FALSE); } + // Set timezone for Joomla on Cron + $config = JFactory::getConfig(); + $timezone = $config->get('offset'); + if ($timezone) { + date_default_timezone_set($timezone); + CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone(); + } + // CRM-14281 Joomla wasn't available during bootstrap, so hook_civicrm_config never executes. $config = CRM_Core_Config::singleton(); CRM_Utils_Hook::config($config); -- 2.25.1