Date format on OpenX API addCampaign method

598 views Asked by At

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.

2

There are 2 answers

1
ox vintage On BEST ANSWER

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')

0
Jorge Guberte On

Turns out it is a simple DateTime(), so nothing of that would work, because the API wants a Date object, not string!

So, the code i sent on the question turns into:

$date = new DateTime();

$date.modify($date_threshold);