Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Google Calendar API events list does not return all data in some edge case

Hi,

I have some python script that calls Google Calendar API events list with start and end set. It seems that there is an edge case that it does not return all data. Other cases work fine.

e.g.

start = "2022-07-12T23:59:59Z"
end = "2022-07-14T00:00:00Z"

I set 1 day event from 13.7.22-13.7.22 whole day event checked and cannot see it in the events list returned only others. What am I missing?? (also tried setting timeZone which is pulled automatically from calendar as default.. but I see it is same behavior, again other cases work great!)

GoogleApiObj._service.events().list(calendarId='primary', timeMin=start, timeMax=end).execute()

Any advice?

Thanks,

Limor

0 2 3,751
2 REPLIES 2

The API documentation for listing events provides a tester tool (API explorer) to perform tests against the Calendar API. You could use this to try your calls and see if you continue seeing the same behavior. The same webpage documents the behavior of the arguments to the API, including ranges such as timeMin and timeMax.

Otherwise, you could look at this similar thread in Stack Overflow dealing with filtering events at a single day. You could also submit your own question with the complete script you use to call the API. If you believe this is an issue with the Python library or API itself, this page shows how to contact the appropriate support.

Thanks for your response🙏 I will check that