简体   繁体   中英

MailChimp API 2.0 timezone

I'm using the MailChimp API to create campagins from my own site. This all works perfectly but for the time.

When I schedule my campaign for say 9:00 PM it will be listed in MailChimp for 11:00 PM. And it wil be send at 11:00 PM as well.

My account settings are set to Central Europe GMT +2 and my server time echo's te correct time as well.

This is my code:

$schedule = $mailchimp->call('campaigns/schedule', array(
   'cid' =>  $campaign['id'],
   'schedule_time' => $date // format yyyy-mm-dd hh:mm:ss
));

Answer from MailChimp:

When passing the time through the campaigns/schedule call, it will be formatted as GMT, as it mentions in the docs.

Since the account is GMT+2, the campaign is scheduled for the GMT time passed in the call, plus the offset for the account, which is causing the two hour difference.

Passing the time in the call as GMT will allow for the campaign to be scheduled as expected.

This works :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM