Scheduling time through API usually wrong

Anonymous
Not applicable

Scheduling time through API usually wrong

We are scheduling digest in marketo through API in PHP  language  the selected schedule time by an admin, but

in marketo campaign schedule it is updated incorrected date.

eg. = We are sending date time from my system 05-07-2017 1:00 PM but updated campaign schedule time in marketo July 5, 2017 6:00 AM showing incorrected

       it should show July 5, 2017 1:00 PM. how can we resolve the issue.

Tags (1)
7 REPLIES 7

Re: Scheduling time through API usually wrong

Hi Dhirendra Kumar​,

Have you checked to see if this is the difference between your system time and the time that Marketo is setup for either in the Marketo System or the User Profile?

Marketo System Time

Screen Shot 2017-07-06 at 08.09.31.png

Marketo User Time

Screen Shot 2017-07-06 at 08.10.30.png

Level 10 - Community Moderator

Re: Scheduling time through API usually wrong

Use ISO8601 UTC.

     2017-07-05T13:00:00Z

Anonymous
Not applicable

Re: Scheduling time through API usually wrong

Hi Sanford,

Thanks for the reply

I am sending date time from my system 06-07-2017 8:00 PM by using above format provided by you but still no luck

incorrected campaign schedule time is updated  Jul 6, 2017 1:00 PM it should be Jul 6, 2017 8:00 PM. please see attached screenshot.

pastedImage_4.png

Below I am using the script for sending date time.

$dtzObj = new \DateTimeZone("Asia/Kolkata");

$dateTime = new DrupalDateTime($time, $dtzObj);

$formatted = $dateTime->format(DATE_ISO8601);

$dateformatted = substr($formatted, 0, -6).'.000Z';

$body->input->runAt = $dateformatted;

Level 10 - Community Moderator

Re: Scheduling time through API usually wrong

I'd need to see the final ISO8601 date you're sending to Marketo after that string mangling (generally speaking if I see substr() run on date output that's a bad sign -- your date library must be capable of outputting in the date and time zone you desire, without further postprocessing).

You shouldn't be sending ISO8601 milliseconds.

Anonymous
Not applicable

Re: Scheduling time through API usually wrong

The final date is  2017-07-06T23:00:0.000Z which is sending to marketo for  campaign schedule and selected date from my system is 06-07-2017 11:00 P.M.

Marketo Employee

Re: Scheduling time through API usually wrong

We're preparing a fix for this in the upcoming minor release, currently scheduled for the last week of July.

Anonymous
Not applicable

Re: Scheduling time through API usually wrong

Hi Kenny,

Any update on this ? Has Issue been fixed in upcoming minor release.