akonadi-ews icon indicating copy to clipboard operation
akonadi-ews copied to clipboard

Microsoft Time Zones are not Mapped Correctly to IANA Time Zones

Open ChrDr opened this issue 8 years ago • 9 comments

Microsoft has its own naming convention for time zones (see https://msdn.microsoft.com/en-us/library/ms912391%28v=winembedded.11%29.aspx) that does not conform to the IANA time zone database (tzdata).

This fills the logs with a lot of messages like: kontact[775]: Cannot open "/usr/share/zoneinfo/GMT Standard Time" kontact[775]: Cannot open "/usr/share/zoneinfo/W. Europe Standard Time" kontact[775]: Cannot open "/usr/share/zoneinfo/Eastern Standard Time"

Besides that, korganizer partly shows the wrong time for the appointments (depending on whether the locally configured timezone conforms to the timezone used for the appointment).

Fixing this would improve the usability of the calendar component of your really great akonadi plugin a lot.

ChrDr avatar May 18 '16 11:05 ChrDr

I am aware of that. The timezone mapping is a mess and conversion is not trivial. I've spend days on trying to get this right and I'm still seeing issues. Blame Microsoft for creating its own "standards".

I'll look deeper into this when working on full calendar support.

KrissN avatar May 18 '16 12:05 KrissN

Hi, First, I would like to thank you for the project, I like it a lot. Related to the timezone issue, icu project also provides a funtion for converting windows time zones, and icu library is present in most of the Linux distros, not sure if you tried that.

http://icu-project.org/apiref/icu4c/classicu_1_1TimeZone.html#a0872f72c5c3204de3c61502be568d72d

mozguletz avatar May 18 '16 12:05 mozguletz

This is actually what I'm using (wrapped by Qt) - see calendar/ewsfetchcalendardetailjob.cpp:272

The problem is that it doesn't always work.

KrissN avatar May 18 '16 12:05 KrissN

I simply symlinked the "missing" timezones to localtime in /usr/share/zoneinfo. That's probably not the correct fix but it speeds up calendar loading by an amazing factor and puts calendar items back into the correct time slot.

kakra avatar Oct 30 '16 10:10 kakra

Is there a Qt bug for the times when it doesn't work? If not, file one. Please send the bug number to me, I'd love to see this fixed :)

gladhorn avatar Aug 16 '17 08:08 gladhorn

This should now be fixed thanks to the refactoring done in KCalCore. The time zones are now matched based on offsets, not names, which reduces the chance that the time zone from an event will fail to be converted.

I'm testing this change now and will let you know if it works.

KrissN avatar Oct 09 '17 10:10 KrissN

How will this interact with time zones that use DST?

kakra avatar Oct 09 '17 18:10 kakra

That I don't know - I did neither write or review that code (https://cgit.kde.org/kcalcore.git/tree/src/icaltimezones.cpp#n466). Time and tests will tell.

KrissN avatar Oct 09 '17 19:10 KrissN

According to the code and the comment that I received from Daniel Vratil the function does take into account DST offsets.

KrissN avatar Oct 09 '17 20:10 KrissN