Skip to content

Commit

Permalink
Merge pull request civicrm#100 from monishdeb/CRM-18062
Browse files Browse the repository at this point in the history
CRM-18062: Mailing processing ignores timezone, and sends mailings at wrong time
  • Loading branch information
Yashodha Chaku committed May 16, 2016
2 parents 593a76e + fa0a863 commit 60695a7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions wp-cli/civicrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,22 @@ private function api() {
}

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)
Expand Down

0 comments on commit 60695a7

Please sign in to comment.