I am setting up the application using Paypal Adaptive Payments.
I am currently making a call to Preapproval, and the specification states that StartDate cannot be until today.
With that in mind ... under which time zone do they check it against?
The SDK API has this in the following example:
$currDate = getdate(); $startDate = $currDate['year'].'-'.$currDate['mon'].'-'.$currDate['mday']; $startDate = strtotime($startDate); $startDate = date('Ym-d', mktime(0,0,0,date('m',$startDate),date('d',$startDate),date('Y',$startDate))); $endDate = add_date($startDate, 1);
However, this date may vary depending on the time zone of the server sending the request.
Anyone have any ideas on how to ensure no problems?
Change w / Bounty:
As of December 15th, we ran into this as a mistake. We use UTC time, and as soon as it starts a new day in UTC, payments will start to fail.
I use the above code in the following place:
$preapprovalRequest->startingDate = $startDate; $preapprovalRequest->endingDate = $endDate;
What do I need to do this job?
Edit 2:
Yes, the time zone is configured as UTC, we did it intentionally so that all time information in our database is stored without a time zone.
Essentially, I'm trying to figure out how to indicate that the date I'm sending to Paypal is in UTC, and not the time zone in which they ended up.
Edit 3:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_APPreapproval
There is an API and it says the following
Source and destination dates can be in eiter Zulu or GMT offset formats. as in the following examples: 2010-09-10Z 2010-09-10T17: 24: 03.874-07: 00
Essentially, I need the code above to output something like this, determining that I am using UTC ...