Google Calendar API doesn't accept DateTime with positive UTC offset?
I'm developing an iOS app that accesses a Google Calendar to display dates of upcoming livestreams.
Google claims that for any argument that takes a DateTime, it must be formatted as ISO 8601, which I understand should look like this: 2015-05-17T18:49:11-07:00 (I live in Southern California, which is normally UTC-08:00 but right now is UTC-07:00 because of Daylight Savings Time) Anyway, in my own testing, my app is generating URLs like the following:
and these are working perfectly, they return the expected calendar data.
However I just recently added a tester who lives in New Zealand, who is in UTC+12:00. His app is generating URLs such as this:
however for him they are NOT working, they return a "400 Bad Request" error from Google.
I did some experimentation, and in my findings, any negative UTC offsets that I try work correctly (e.g. Hawaii, who is UTC-11:00, Anchorage which is UTC-09:00) however none of the positive GMT offsets work (New Zealand @ UTC+12:00, Japan @ UTC+09:00)
What am I doing wrong?
Edit: I've worked around the issue for now by converting all of my times into UTC and specifying them as, e.g., 2015-05-17T18:49:11Z, then adding timeZone=America/Los_Angeles (or Asia/Tokyo or wherever the user is) to the API call. Google seems to accept this. I'd still like to know why, even though they claim that ISO 8601 format strings are accepted, they in actuality aren't (this is especially odd/puzzling/frustrating considering that Google's reply, i.e. the actual calendar data that my app receives, in fact, actually contains ISO 8601 date strings with positive offsets, such as 2015-06-15T09:00:00+09:00.)
Yep, this seems to be a bug. I'm in Spain (UTC+01:00) and I was going crazy with this, given that the response data is as you say formatted with the positive offset.
I'm using it for the timeMin paramter in the http request to get only future events. Ended up putting the current datetime adding the last "Z" as string. Apparently works fine, but I'm in the same timezone the calendar has defined. When that is not the case I guess you have a problem there if you want it with hour precession.
The timeZone parameter apparently is only for the response data.