Skip to content

Commit

Permalink
Utilize getTimeZoneString() method
Browse files Browse the repository at this point in the history
Co-Authored-By: jgillmanjr <jason@rrfaae.com>
  • Loading branch information
seamuslee001 and jgillmanjr committed Jan 14, 2019
1 parent f045e2e commit e878028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Core/Payment/PayPalIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public function getInput(&$input, &$ids) {
$paymentDate = $this->retrieve('payment_date', 'String', FALSE);
if (!empty($paymentDate)) {
$receiveDateTime = new DateTime($paymentDate);
$systemTimeZone = new DateTimeZone(date_default_timezone_get());
$systemTimeZone = new DateTimeZone(CRM_Core_Config::singleton()->userSystem->getTimeZoneString());
$receiveDateTime->setTimezone($systemTimeZone);
$input['receive_date'] = $receiveDateTime->format('YmdHis');
}
Expand Down

1 comment on commit e878028

@tomhughes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be causing exceptions to be thrown when using wordpress because getTimeZoneString() just returns the value of the timezone_string option which is not set. Exception is:

DateTimeZone::__construct(): Unknown or bad timezone ()

Please sign in to comment.