从Google日历获取当天活动的列表 [英] Get list of the day events from Google Calendar
问题描述
我不知道如何获取特定日期的事件列表,而不管它们是从一天开始还是之前,还没有结束?
I can not figure out how to get a list of events of a particular day, no matter whether they started the day or before and are not over yet?
在此页面中 https://developers.google.com/google-apps/calendar/v3/reference/events/list 我已经阅读了两个可选参数 timeMax —上排.开始事件时间和 timeMin 的界限-较低.结束事件时间的界限. 但是问题是,如何正确设置它们以获取在特定日期发生的所有事件,例如2012-10-25
In this page https://developers.google.com/google-apps/calendar/v3/reference/events/list I've read about two optional parameters timeMax — upper excl. bound of start event time and timeMin — lower incl. bound of end event time. But the question is, How to set them in right way to get all events that happens at certain day, e.g. 2012-10-25
如果我是对的, timeMax ='2012-10-25T23:59:59Z'-给了我可能始于的事件?到这个日期时间 timeMin ='2012-10-25T23:59:59Z'-给了我截至该日期时间的事件
If i'm right, timeMax='2012-10-25T23:59:59Z' — gave me events that possibly starts from ? to this datetime timeMin='2012-10-25T23:59:59Z' — gave me events that ends this datetime
推荐答案
实际上,我认为这应该是:
Actually, I think this should be:
timeMin='2012-10-25T00:00:00Z'
timeMax='2012-10-26T00:00:00Z'
由于在您的示例中timeMax
是排他性的,如果您碰巧在25日晚上11:59:59发生了日历事件,则您将不会检索它(我知道,但仍然有可能).
Since timeMax
is exclusive in your example if you happen to have a calendar event on the 25th at 11:59:59pm you wouldn't retrieve it (rare, I know, but still possible).
这是我的工作方式,即使现在我在检索日历事件时遇到另一个问题.
This is how I've done it, even though now I'm running into another issue with retrieving calendar events.
这篇关于从Google日历获取当天活动的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!