doubeiji2602 2013-11-08 13:06
浏览 45

常量联系API错误:“计划日期在当前时间之前。”

We're currently using the API to create campaigns, and all seems to be working fine. When we try to schedule the campaign, however, we are getting errors. When we try to use the example format for 'schedule_date' from one of the SDK libraries:

$time =  date('Y-m-d\TH:i:s\.000\Z', strtotime("+1 hour"));
$schedule = new Schedule();
$schedule->scheduled_date = $time;

We get an error that saying

Scheduled date is before the current time.

When we echo the $time to the screen, we see that it is in fact one hour in the future. (We are in EST).

When we try to use the standard PHP format for ISO-8601 (lowercase 'c') we get and error saying

"#/scheduled_date: Value is not a valid ISO-8601 date time format."

$dt =  date('c', strtotime("+1 hour"));
schedule = new Schedule();
`$schedule->scheduled_date = $dt

I'm sure there is something obvious we are missing, so any help would be greatly appreciated.

  • 写回答

1条回答 默认 最新

  • dsnw2651 2013-12-05 19:55
    关注

    I would definitely try using the DateTime class (http://php.net/manual/en/class.datetime.php) in conjunction with DateTimeZone to see if that alleviates the issue.

    We've also updated our Date/Time parser to accept more formats, which should hopefully take care of the issue you ran into when trying to use date('c')

    If you keep running into issues let me know!

    Thanks, Mike

    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序