Best practices for dates when creating campaigns and placements?

204 views
Skip to first unread message

Joshua Davison

unread,
Jun 20, 2011, 4:38:45 PM6/20/11
to google-doubleclick-...@googlegroups.com
Hi, 

I'm trying to create a campaign that starts January 1, 2012 and ends January 15, 2012 with one placement that uses the campaign's start and end dates. When I try to save the placement, I'm getting an error that says the placement's end date is outside the campaign's dates. 

I'm located in the Central US timezone, so when I send the start and end dates they look like: 2012-01-01T00:00:00-06:00 and 2012-01-15T00:00:00-06:00 

Here's what the DFA docs say about dates and times:
Dates and times - You can save dates/times in xsd:dateTime format using local time zones; all values returned by the API are in UTC. Dates and times are shown in Eastern Standard Time on the website.
When I send 2012-01-15T00:00:00-06:00, I would expect the API to return the same time in UTC as 2012-01-15T06:00:00Z

But when I retrieve the Campaign object, the end date is 2012-01-15T05:00:00Z, which is 2012-01-15T00:00:00-05:00 (Eastern Standard Time) and 2012-01-14T23:00:00-06:00 Central Standard Time, so I can't understand how that would be past the end date of the campaign.

Can anyone tell me if they've run into a similar problem, or if there is an established practice for setting start/end dates on placements and campaigns?

Thanks
-Josh

DFA API Advisor

unread,
Jun 22, 2011, 10:45:20 AM6/22/11
to Google's DoubleClick for Advertisers API Forum
Hi Josh,

This issue was just recently brought to our attention and is scheduled
to be fixed in the next API release (v1.15). There is a work-around,
but first let me explain what you're seeing here.

The API returning times in UTC is just to standardize the SOAP
messages. It's best to ignore the UTC time and just deal with your
local time versus EST.

Many objects in DFA allow you to narrow date ranges down only to the
month/day/year level, not down to hour/minute/second. Campaigns are
one such object since they always start and end at midnight. However,
any object that runs with standard, pre-defined start and end times
always uses Eastern Standard Time or Eastern Daylight Time (EST or
EDT). You are saving your campaign to end at midnight, January 15th
CST, but the server will interpret this as ending at midnight, January
15th in EST.

So why are you running into a problem? The API's behavior for
validating placement dates is currently incorrect. As mentioned above,
campaigns use the dates you specify with the time of midnight EST.
There is an issue where placements compare using the time you set. You
are setting your placement's ending to midnight CST, which is 1 AM
EST, which is one hour past the end of your campaign.

The solution is simple - save your placement with an end date that is
equivalent midnight EST or earlier. Come the next release of the API,
this will be done automatically for you.

Regards,
- Joseph DiLallo, the DFA API Team

On Jun 20, 4:38 pm, Joshua Davison <dact...@gmail.com> wrote:
> Hi,
>
> I'm trying to create a campaign that starts January 1, 2012 and ends January
> 15, 2012 with one placement that uses the campaign's start and end dates.
> When I try to save the placement, I'm getting an error that says the
> placement's end date is outside the campaign's dates.
>
> I'm located in the Central US timezone, so when I send the start and end
> dates they look like: 2012-01-01T00:00:00-06:00
> and 2012-01-15T00:00:00-06:00
>
> Here's what the DFA docs say about dates and times:
>
> *Dates and times* - You can save dates/times in xsd:dateTime format using

Josh Davison

unread,
Jun 22, 2011, 11:23:41 AM6/22/11
to google-doubleclick-...@googlegroups.com
Thanks, that's exactly how I resolved it -- we now convert all our times to Eastern time zone when sending them to the API.

- Josh

Sent from my iPhone.

Reply all
Reply to author
Forward
0 new messages