-
Notifications
You must be signed in to change notification settings - Fork 13
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
Synced Timezone wrong #168
Comments
Hey! Thanks for the bug report! (and sorry for the late response!) Could you give me some more details? Are you using different timezone's in both calendars? |
I basically sync to the same account in a different calendar for testing, so i guess the timezones are the same? |
@alxndr13 is it possible that for the Outlook to Outlook use case, timezone is not handled properly ? https://github.com/inovex/CalendarSync/blob/main/internal/adapter/outlook_http/client.go#L275 |
@Trefex i just found the time to dig deeper into this. Thanks for the bug report again! We definitely aren't handling timezones the way we should. I tested this as follows: Created an event in my outlook source and made sure to use a different timezone. (Asia/Tomsk) The event will then be represented in the API Response in UTC[1], the only fields which would cover the timezone correctly is the This is also why it is working all the time for my case, where i have outlook as the sink: i just retrieve the UTC Time and write it in UTC to my google sink. The clients then represent the events according to my machines timezone. In case we use outlook as a sink, we should make sure to convert (and set) the timezone to UTC when retrieving events. Your local client should then show the time according to your preferred timezone. Need to attend a padel match now, will have a deeper look at this in the coming days i hope. |
@alxndr13 this is indeed documented here it seems: https://learn.microsoft.com/en-us/graph/api/user-list-events?view=graph-rest-1.0&tabs=http#support-various-time-zones |
Hi @Trefex, could you try to build the app with the |
@alxndr13 it is the same result. All events are shifted by 2 hours (I am in CEST). From the PR, it seems though as the timezone is not set / added in https://github.com/inovex/CalendarSync/blob/main/internal/adapter/outlook_http/client.go#L275 ? I think the timeZone need to be set as well when writing back the event in Outlook, otherwise you will write the time in UTC?
|
ah, understood. This is uncoventional, as this differentiates it from the google adapter.. When writing calendar events into the google sink using UTC as the events timezone, it is still always represented in your computers timezone. (which makes sense, it's the same time, just differently displayed) Example flow when outlook is my source and google my sink:
Which is what i would expect.. But outlook seems to handle this differently and presents the event in it's original timezone and not your local timezone, which doesnt make sense imo. (why would you look at events where each event has a different timezone??) (not sure if this is actually the case but this would explain the behaviour you're describing) EDIT: nope, can't reproduce your isse @Trefex .. Created an event in my google source at 2:30pm GMT+3, showed up as 1:30pm in google calendar (local timezone is +2). After the sync it was shown at 1:30pm in my outlook sink as well.. see: Maybe i need some more data from the events you try to sync @Trefex ... |
@alxndr13 what if you use Outlook as source and Outlook as sync ? I can provide a calendar JSON if that would help. Is there a way to get full debug info of what is actually written to the sink ? |
@Trefex used google as source, outlook as sink in the example above. Calendar JSOn would help, yes. Please make sure to remove all personal information |
Source (Outlook)
Sink (Outlook)
|
Hi @Trefex, fyi: Yesterday was my last day at Inovex. Since I won't be using CalendarSync daily anymore, addressing this issue will take some time as I'm focusing on my new role. |
I've read through the issue and am still confused what's going on.
2024-09-20T11:00:00 gets marked as CEST. After normalizing that timestamp again to UTC, we're now at 2024-09-20T9:00:00 . (not sure why the event snippets show a time diff of three hours though).
Can you try whether setting the environment variable |
@MichaelEischer this indeed fixes the issue. I have now tested on the #187 branch. Would this require a fix in the code or should the docs be updated to reflect the TZ env variable be set to UTC Thank you ! |
This definitely should be fixed in the code, the current inconsistent timezone handling is definitely broken. Not sure when I'll get around to fix it. |
No worries, in the meantime, the workaround is fine. I am more curious about #166 :) |
fixed via #187. |
Hi,
In my source, events are at 1 PM, but in the sink, they will be synced as 11 AM.
Are timezones perhaps not handled correctly or is it something i missed in a config?
Thanks
T
The text was updated successfully, but these errors were encountered: