-
Notifications
You must be signed in to change notification settings - Fork 44
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
TimeZone trouble #9
Comments
Well I don't quite understand what are you trying to achieve. .NETStandard has a limited support of TimeZones. And you can see it in TimeZoneExtensions.cs. Mostly because there's no TimeZoneInfo.GetAdjustmentRules function TimeZoneDefinition class becomes a bit of a fake which only makes sense for UTC. Could you supply UTC Timezone when creating ExchangeService object and handle all timezone conversions for yourself? Than all your internal timezone issues will go away I suppose. |
I know about the limited support for timezones in .NET Standard. That is why I would like to only override the id that gets serialized in the request. Which is in timezonedefinition. The conversions rules are correctly loaded from the timezone, but if the timezone sn't correct Outlook shows that the appointment is in an other timezone ("West Africa" with the same offset). And because the users timezone is not the same as the appointment timezone it shows up at the correct time (e.g. 08:30) but it shows 07:30 GMT +1 in the appointment. This is very confusing for the user and I think it is an Exchange bug, but if only the ID would be overridden before it gets put in the soap header, all the confusion disappears. And the actual ID that gets serialized is in TimeZoneDefinition and not in the sealed class TimeZoneInfo. Sorry if I didn't explain it correctly it is a complex issue. (with a possibly easy fix) This could also be a solution in ExchangeServiceBase
|
Do you know that with NET Core 2.0 you can create custom timezone and supply it to ExchangeService ? So you can have any id you want:
Does that help? |
That would help a little, sadly the roadmap says it will not be released before Q3. And that would also make the developer responsible for setting the daylight saving stuff and all the other properties. While the timezone info is correct only Exchange just wants the Windows ID. So sending the Unix ID results in user notices that the appointment is in some other timezone. After thinking about this some more it would even make sense in making a translation table and always translate the timezone id to the Windows version before putting it in the soap header. Because setting the timezone to "Europe/Amsterdam" (GMT+1) results in "West Africa" (also GMT+1). That makes me wonder how it works, on the Exchange side. Think it tries to match the the id and if it isn't in the list of time zones it just takes the first one with the same offset. |
It seems that this library could take a dependency on my TimeZoneConverter library to resolve this problem. |
So concluding the strange issues with Exchange choosing the wrong timezone for appointments created with this library, could be solved by replacing this part with:
What do you think about that @sherlock1982??? In my opinion it is wrong to send a TimeZoneId to Exchange that it doesn't understand. And instead of creating something to convert the IDs this library could be using an already existing lib for that. |
Note that if one wanted to not take a hard dependency, you could simply expose some settings property that is a |
Made this code available:
|
@sherlock1982 this fix works perfectly! Thanks for the help. |
What if I need to change the default timezone? The following doesn't work:
|
Could you guys make the Id of TimeZoneDefinition overridable? And TimeZoneDefinition public?
Why I'm asking: Normally you could set the TimeZone of appointments with this property. By setting the correct timezone while creating the
ExchangeService
, but on Unix the TimeZoneIds are different then the ones Exchange is expecting.Unix:
Europe/Amsterdam
Windows (and Exchange):
W. Europe Standard Time
If you would know what you're doing this smallllll change would solve a lot of TimeZone trouble for this project, which is really great by the way!!!
The text was updated successfully, but these errors were encountered: