6
votes

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

2

2 Answers

18
votes

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.

0
votes

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.