Skip to content
Snippets Groups Projects
Commit aff0694b authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

CRM-18062: Mailing processing ignores timezone, and sends mailings at wrong time

parent b0990371
No related branches found
No related tags found
No related merge requests found
......@@ -203,8 +203,22 @@ if (!defined('CIVICRM_WPCLI_LOADED')) {
}
civicrm_initialize();
// CRM-18062: Set CiviCRM timezone if any
$wpBaseTimezone = date_default_timezone_get();
$wpUserTimezone = $this->getOption('timezone', get_option('timezone_string'));
if ($wpUserTimezone) {
date_default_timezone_set($wpUserTimezone);
CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone();
}
$result = civicrm_api($entity, $action, $params);
// restore WP's timezone
if ($wpBaseTimezone) {
date_default_timezone_set($wpBaseTimezone);
}
switch ($this->getOption('out', 'pretty')) {
# pretty-print output (default)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment