I am having problems when I encode a connection using the OpenX API with XML-RPC2. I am having a problem with the fact that the data function is the date function - DateTime.iso8601.
This is my code:
$sdatetime = new DateTime('2013-01-01 00:00:00');
$edatetime = new DateTime('2013-06-01 00:00:00');
$startDate = $sdatetime->format(DateTime::ISO8601);
$endDate = $edatetime->format(DateTime::ISO8601);
try {
$result = $aClient->agencyPublisherStatistics($sessionId, 1, $startDate, $endDate);
print_r($result);
} catch (XML_RPC2_FaultException $e) {
die('Exception #' . $e->getFaultCode() . ' : ' . $e->getFaultString());
}
This is the result error when I run the script above:
Exception No. 3: parameters passed to the method are incorrect: Wanted dateTime.iso8601, received a line in param 3
If I run print_r(gettype($startDate));, I get data of type string not date .
My question is for variables $startDateand $endDatehow to make them a data type dateTime.iso8601or datenot string.
Thank.
source
share