Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google api 获取两个日期之间的日历事件_Google Api_Google Calendar Api_Google Api Php Client - Fatal编程技术网

Google api 获取两个日期之间的日历事件

Google api 获取两个日期之间的日历事件,google-api,google-calendar-api,google-api-php-client,Google Api,Google Calendar Api,Google Api Php Client,如何获取两个特定日期之间的所有事件。例如,我只想获取2013年3月1日和2013年3月28日之间的事件 我正在使用谷歌日历API v3。在Google Calendar API v1中,有一个工具可以使用start-min和start-max在两个日期之间进行搜索。我想知道Google Calendar API v3中这两个参数的替代品是什么?只需在获取事件提要之前将这两个参数添加到查询中即可: // Start date from where to get the events $query-

如何获取两个特定日期之间的所有事件。例如,我只想获取2013年3月1日和2013年3月28日之间的事件


我正在使用谷歌日历API v3。在Google Calendar API v1中,有一个工具可以使用start-min和start-max在两个日期之间进行搜索。我想知道Google Calendar API v3中这两个参数的替代品是什么?

只需在获取事件提要之前将这两个参数添加到查询中即可:

// Start date from where to get the events
$query->setStartMin('2013-01-01');
// End date
$query->setStartMax('2013-03-20');
如需进一步参考,请参阅:


希望这有帮助。

好的,我得到了答案。Google API V3中的新参数是
timeMin
&
timeMax
,用于过滤两个日期之间的事件。

我正在使用Google Calendar API V3。而在Google Calendar API v1中,使用
start min
start max
可以在两个日期之间进行搜索。我想知道Google Calendar API v3中这两个参数的替代品是什么。很高兴你找到了解决方案:)嗨,你的答案可能对我很有帮助。您是如何应用这些参数的?您在Javascript中使用过它吗?没有,我在Google PHP API中使用过它。PHP客户端Libs的示例:
$service->events->listEvents('primary',array('timeMin'->'2013-03-01T00:00:00-04:00','timeMax'->'2013-03-28T23:59:59-04:00')注意时间戳是RFC 3339格式的。所有参数都可以在这里找到:您也可以在这里看到值的格式-