问题
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?
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
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
回答1:
Actually, I think this should be:
timeMin='2012-10-25T00:00:00Z'
timeMax='2012-10-26T00:00:00Z'
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.
回答2:
I beg your pardon, the setting of timeMin open-bound and that of timeMax is close-bound in the lookup period. Setting the values to timeMin='2012-10-25T00:00:01Z' and timeMax='2012-10-25T23:59:59Z' will give the desired output.
来源:https://stackoverflow.com/questions/13032011/get-list-of-the-day-events-from-google-calendar