Answers.Body: <p>wp-cli doesn't bootstrap the settings, so doesn't load the timezone.</p>
  
  <p>Because of this exact issue, I wrote a patched version of the CiviCRM extension for wp-cli to add timezone support.  It's available <a href="https://github.com/PalanteJon/wp-cli-civicrm" rel="nofollow">here</a>.  As far as I can tell, the original author has abandoned the project, because they haven't merged any pull requests (including this patch) in over a year.</p>
  
  <p>You can also use wget-based cron - but then you're subject to your webserver's PHP timeouts, as opposed to the CLI PHP timeout, which is usually higher (or non-existent).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-11T14:01:19.337Z
Answers.Text: I REALLY wish that I could use the wget/cURL/PHP methods.  However, I get the "Invalid Username/Password" error that others have also experienced.  Thanks for the patch, I'll apply that and see if I get anywhere.
Answers.UserDisplayName: G H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-11T14:21:33.570Z
Answers.Text: Jon, doing a quick dig through, it looks like Civi has pulled this into the base code.  It seems like this should be a bug report, with a simple update easily going back.
Answers.UserDisplayName: G H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-11T14:40:14.443Z
Answers.Text: BTW, I only did the timezone piece to my install by editing wp/wp-content/plugins/civicrm/wp-cli/civicrm.php with:  (Added lines 2 and 3)
  civicrm_initialize();
               $timezone = $this->getOption('timezone', get_option('timezone_string'));
               date_default_timezone_set($timezone);
               $result = civicrm_api($entity, $action, $params);
Answers.UserDisplayName: G H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-11T17:54:15.923Z
Answers.Text: @GH - when you say "it looks like Civi has pulled this into the base code", I'm not sure what you mean.  Could you please elaborate?
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-11T18:08:32.030Z
Answers.Text: On the 4.7 install, it's got the standard CiviCRM code ownership comment above what is on GitHub.  I haven't taken the time to do a diff between the installed and the GitHub version beyond that.  However, because it's got the commented out section above the code, I'd assume that CiviCRM is no longer pulling from the GitHub version.  I could be making a wrong assumption though.
Answers.UserDisplayName: G H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-11T05:33:51.330Z
Answers.LastActivityDate: 2016-02-11T05:33:51.330Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Not sure what exactly broke, but upgrading to CiviCRM 4.7.1 on CentOS 6 required adding PHP 5.4 via the SCL repo.  Something in that process broke the cURL/wget/php cron job calls.  (Invalid username/password despite logs showing it correctly.  See <a href="https://issues.civicrm.org/jira/browse/CRM-17981" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-17981</a>)  So, I created a cron job with:
  scl enable php54 "wp --user= --url= --path=/path/to/wp/ civicrm api job.execute auth=0"
  It runs, and everything seems fine.  However, when I go to Scheduled Jobs, everything reports as using a GMT/UTC timezone.  If I click to run manually, it reports the local time.  I've check the php.ini file and it has the correct timezone declared, as does the site's Settings page.  Anybody got a clue?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-25T22:52:06.027Z
Comments.Text: We are seeing something similar in Drupal. The report listing when the emails are sent shows a 10 AM EDT time stamp. The time stamp on opens shows 2 PM. Who ever tries to fix it please check all the time stamps.
Comments.UserDisplayName: user469
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-26T01:41:37.997Z
Comments.Text: What you're seeing is a different issue from this.  You may want to post it as a separate question.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-26T21:46:33.893Z
Comments.Text: If you have a new question, please ask it by clicking the [Ask Question](http://civicrm.stackexchange.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/low-quality-posts/3470)
Comments.UserDisplayName: Jon G - Megaphone Tech
Tags: <wordpress><cron-job><timezone><cron>
Title: WP-CLI using GMT/UTC Timezone on cron jobs
ThreadText: # WP-CLI using GMT/UTC Timezone on cron jobs
  
  (Asked by: username_0 on 2016-02-10)
  
  Not sure what exactly broke, but upgrading to CiviCRM 4.7.1 on CentOS 6 required adding PHP 5.4 via the SCL repo. Something in that process broke the cURL/wget/php cron job calls. (Invalid username/password despite logs showing it correctly. See <https://issues.civicrm.org/jira/browse/CRM-17981>) So, I created a cron job with:
  scl enable php54 "wp --user= --url= --path=/path/to/wp/ civicrm api job.execute auth=0"
  It runs, and everything seems fine. However, when I go to Scheduled Jobs, everything reports as using a GMT/UTC timezone. If I click to run manually, it reports the local time. I've check the php.ini file and it has the correct timezone declared, as does the site's Settings page. Anybody got a clue?
  
  **Tags:** wordpress, cron-job, timezone, cron
  
  > **Comments:**
  > **username_1**: We are seeing something similar in Drupal. The report listing when the emails are sent shows a 10 AM EDT time stamp. The time stamp on opens shows 2 PM. Who ever tries to fix it please check all the time stamps.  
  > **username_2**: What you're seeing is a different issue from this.  You may want to post it as a separate question.  
  > **username_2**: If you have a new question, please ask it by clicking the [Ask Question](http://civicrm.stackexchange.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/low-quality-posts/3470)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-02-11. Score: 2 | Accepted answer
  
  wp-cli doesn't bootstrap the settings, so doesn't load the timezone.
  
  Because of this exact issue, I wrote a patched version of the CiviCRM extension for wp-cli to add timezone support. It's available [here](https://github.com/PalanteJon/wp-cli-civicrm). As far as I can tell, the original author has abandoned the project, because they haven't merged any pull requests (including this patch) in over a year.
  
  You can also use wget-based cron - but then you're subject to your webserver's PHP timeouts, as opposed to the CLI PHP timeout, which is usually higher (or non-existent).
  
  > **Comments:**
  > **username_0**: I REALLY wish that I could use the wget/cURL/PHP methods.  However, I get the "Invalid Username/Password" error that others have also experienced.  Thanks for the patch, I'll apply that and see if I get anywhere.  
  > **username_0**: Jon, doing a quick dig through, it looks like Civi has pulled this into the base code.  It seems like this should be a bug report, with a simple update easily going back.  
  > **username_0**: BTW, I only did the timezone piece to my install by editing wp/wp-content/plugins/civicrm/wp-cli/civicrm.php with:  (Added lines 2 and 3) civicrm_initialize();              $timezone = $this->getOption('timezone', get_option('timezone_string'));              date_default_timezone_set($timezone);              $result = civicrm_api($entity, $action, $params);  
  > **username_2**: @GH - when you say "it looks like Civi has pulled this into the base code", I'm not sure what you mean.  Could you please elaborate?  
  > **username_0**: On the 4.7 install, it's got the standard CiviCRM code ownership comment above what is on GitHub.  I haven't taken the time to do a diff between the installed and the GitHub version beyond that.  However, because it's got the commented out section above the code, I'd assume that CiviCRM is no longer pulling from the GitHub version.  I could be making a wrong assumption though.  
  
  ---
  
  