Search code examples
phpapidateopenx

Date format on OpenX API addCampaign method


I'm creating a campaign through the OpenX API, and so far so good but i need to set an end date to the campaign, via the endDate parameter; the thing is: i don't know what i should bind to the parameter on the API call. I tried using this: $date = date("Y-m-d H:i:s",strtotime(date("Y-m-d H:i:s") . $date_threshold)); where $date_threshold is something like "+1 month", but the endDate won't appear on the OpenX panel.

What kind of data do i need to bind to that parameter so it's correctly inserted on the OpenX database? Thank you in advance.


Solution

  • Glad you got it to work -- Just as a note: I'm not sure how you handle the general XML-RPC communication, but what I do is pass a date string into PEAR's XML-RPC, something like:

    new XML_RPC_Value('20100413T00:00:00', 'dateTime.iso8601')