From: Jason Gillman Jr Date: Mon, 14 Jan 2019 15:57:34 +0000 (-0500) Subject: Quick comment describing need for IPN TZ adjustment X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6800eef17283b8065b9ab2bb51e90441bbba8301;p=civicrm-core.git Quick comment describing need for IPN TZ adjustment --- diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 4248d1c848..6af63aaeee 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -394,6 +394,10 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { $paymentDate = $this->retrieve('payment_date', 'String', FALSE); if (!empty($paymentDate)) { $receiveDateTime = new DateTime($paymentDate); + /** + * The `payment_date` that Paypal sends back is in their timezone. Example return: 08:23:05 Jan 11, 2019 PST + * Subsequently, we need to account for that, otherwise the recieve time will be incorrect for the local system + */ $systemTimeZone = new DateTimeZone(CRM_Core_Config::singleton()->userSystem->getTimeZoneString()); $receiveDateTime->setTimezone($systemTimeZone); $input['receive_date'] = $receiveDateTime->format('YmdHis');