{"action":"created","issue":{"url":"https://api.github.com/repos/andy-walker/wp-cli-civicrm/issues/4","labels_url":"https://api.github.com/repos/andy-walker/wp-cli-civicrm/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/andy-walker/wp-cli-civicrm/issues/4/comments","events_url":"https://api.github.com/repos/andy-walker/wp-cli-civicrm/issues/4/events","html_url":"https://github.com/andy-walker/wp-cli-civicrm/pull/4","id":63850914,"number":4,"title":"Add timezone support to API command","user":{"login":"PalanteJon","id":1796012,"avatar_url":"https://avatars.githubusercontent.com/u/1796012?v=3","gravatar_id":"","url":"https://api.github.com/users/PalanteJon","html_url":"https://github.com/PalanteJon","followers_url":"https://api.github.com/users/PalanteJon/followers","following_url":"https://api.github.com/users/PalanteJon/following{/other_user}","gists_url":"https://api.github.com/users/PalanteJon/gists{/gist_id}","starred_url":"https://api.github.com/users/PalanteJon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PalanteJon/subscriptions","organizations_url":"https://api.github.com/users/PalanteJon/orgs","repos_url":"https://api.github.com/users/PalanteJon/repos","events_url":"https://api.github.com/users/PalanteJon/events{/privacy}","received_events_url":"https://api.github.com/users/PalanteJon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-23T22:40:15Z","updated_at":"2015-03-24T21:41:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/andy-walker/wp-cli-civicrm/pulls/4","html_url":"https://github.com/andy-walker/wp-cli-civicrm/pull/4","diff_url":"https://github.com/andy-walker/wp-cli-civicrm/pull/4.diff","patch_url":"https://github.com/andy-walker/wp-cli-civicrm/pull/4.patch"},"body":"I was having trouble using \"wp civicrm api job.execute\", because Wordpress overrides PHP's timezone settings.  While CiviCRM GUI gets the correct timezone from an override in wp-settings.php, the CiviCRM called via wp-cli gets UTC as the timezone.\r\n\r\nTo account for this, I've added support for a new option, \"--timezone\", to your code.  I can imagine you might want to refactor such that this is a global option - but then again, maybe not.  I'm open to feedback for improving this!"},"comment":{"url":"https://api.github.com/repos/andy-walker/wp-cli-civicrm/issues/comments/85705402","html_url":"https://github.com/andy-walker/wp-cli-civicrm/pull/4#issuecomment-85705402","issue_url":"https://api.github.com/repos/andy-walker/wp-cli-civicrm/issues/4","id":85705402,"user":{"login":"PalanteJon","id":1796012,"avatar_url":"https://avatars.githubusercontent.com/u/1796012?v=3","gravatar_id":"","url":"https://api.github.com/users/PalanteJon","html_url":"https://github.com/PalanteJon","followers_url":"https://api.github.com/users/PalanteJon/followers","following_url":"https://api.github.com/users/PalanteJon/following{/other_user}","gists_url":"https://api.github.com/users/PalanteJon/gists{/gist_id}","starred_url":"https://api.github.com/users/PalanteJon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PalanteJon/subscriptions","organizations_url":"https://api.github.com/users/PalanteJon/orgs","repos_url":"https://api.github.com/users/PalanteJon/repos","events_url":"https://api.github.com/users/PalanteJon/events{/privacy}","received_events_url":"https://api.github.com/users/PalanteJon/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T21:41:12Z","updated_at":"2015-03-24T21:41:12Z","body":"Hi Mikel,\r\n\r\nI'll certainly explore to make sure that setting the timezone_string option solves the problem that editing wp-settings.php does - but since wp-settings.php is loaded AFTER wp-config.php, and contains a call to date_default_timezone_set, changing wp-config.php has no effect.\r\n\r\nThis is also pretty off-topic for this patch, which solves a problem that no amount of config file editing will help."}}