-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recurring yearly appointments created using Google API #853
Comments
The mixture of "Google .NET client libraries" and "date/time issues" is right up my street. I don't have the cycles to look at this immediately, but I'll try to do so as soon as I can - probably answering the SO question as that'll have a wider audience. The difference between the year 1970 and the year 2000 is easy to get started on. Looking at https://www.timeanddate.com/time/zone/poland/warsaw, we can see that on October 14th 2000, Warsaw was at UTC+2. On October 14th 1970, Warsaw was at UTC+1. So that's the difference involved, but it's not clear to me why the 1970 event would have been translated to 08:00 UTC. I'll need to dig into what's doing the time zone conversions in the client library. (Of course, all of this would be better with Noda Time... if I ever do a hand-written Google Calendar client library, I would hope to use Noda Time all the way :) |
October I wonder if they changed when they apply daylight savings time? Warsaw
Does this mean between those years they didn't actually have daylight savings time?
|
@LindaLawton: Yes, exactly. If you look at http://nodatime.org/tzvalidate/generate and search for "Europe/Warsaw" you can find all the time zone transitions until 2035 - you'll see there's a big gap:
|
So if that's what the time offset was then or lack there of one. I am inclined to think that what the API and client library are doing is correct. Just curious though: Why we are storing events in Google calendar for 1970. Not that i am apposed to finding weird bugs for the fun of it. |
Typically those are bithdays ;). Issue was reported by user here: https://sourceforge.net/p/googlesyncmod/bugs/866/ I think he is not from Poland, so problem could be not only for Warsaw time zone. And just to repeat, If I create the same events in "Google API Explorer" everything works as it should.... |
Start date and end date need to be RFC3339 dates. Code says:
Documentation says:
Note: this is independent of the fact that you are sending the timezone parameter. @jskeet can correct me if i am wrong but by doing this
Its just creating a date variable it in the default timezone or system timezone. Its not actually in Warsaw time. Still digging trying to figure out how we parse these to send them to the API. @jskeet found this ConvertToRFC3339 |
No, if the API is converting That EDIT: Yes, judging by that ConvertToRfc3339, it's assumed to be system local time zone. That's a pain, but probably too late to fix. From a "change to client code" perspective, it would be best to pass in a |
Looks to me like if its unspecified we are saying its universal casting it as a string and then sending it to the API.
Which makes me think if he "specifies" the time zone when he creates the date it will cast correctly and work. Then we can argue if we should be casting this to Universal in the first place. @jskeet I blame you for getting me hooked on this datetime fun. |
No, if it's unspecified, we're assuming it's system local and converting it to UTC with |
@obelix30 any chance you know what time zone the calendar in question is set to i want to test this with some raw HTTP calls, bothers me that Explorer works and client library doesn't. |
My Google calendar time zone is set "(GMT+02:00) Berlin" |
@jskeet any progress on this one? I have learned there are other TZ impacted (for example Europe/Prague) they have probably the same gaps as Europe/Warsaw |
@obelix30: As I mentioned earlier, basically you should pass in a |
Looks like a using UTC |
I posted this question to StackOverflow (http://stackoverflow.com/questions/39966524/recurring-yearly-appointments-created-using-google-api) but got no reply with real solution. Additionally I have tested that Google APIs Explorer gives correct results, so something could be wrong with .NET client
I am working on Open Source app to synchronize calendars between Google and Outlook. Some users reported some strange behavior for recurring appointments with start date years ago. Below there is sample code, all asserts are passing. My question is why for appointment starting 1970-10-14T08:00:00.000Z hour is shifted by API to 09:00:00+01:00 and if I shift start date to year 2000 it is shifted to 10:00:00+02:00 ? When I check how both events looks in Google they are starting on different hours, and in my opinion should start the same hour (as only year was changed)
And I would like to know what I need to do to save old recurring appointments correctly to Google? Should I have some separate logic which depends on year?
Many thanks for help!
The text was updated successfully, but these errors were encountered: