Bug 165212 - Configured time zone is not always honored
Summary: Configured time zone is not always honored
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: 5.3.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2008-06-28 17:07 UTC by Georg Wittenburg
Modified: 2021-02-04 20:18 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.16.3


Attachments
Test event (869 bytes, application/octet-stream)
2008-06-29 02:10 UTC, Christophe Marin
Details
Image showing different times for the same events. (161.35 KB, image/jpeg)
2008-10-02 00:56 UTC, Sergio PR
Details
Screenshot (223.38 KB, image/png)
2009-01-03 01:33 UTC, Georg Wittenburg
Details
month view showing wrong on wrong date (195.36 KB, image/png)
2009-02-06 22:39 UTC, James
Details
Migrate ICS from KDE 3.x to KDE 4.x (1.90 KB, text/plain)
2009-02-09 21:06 UTC, Michael Eager
Details
Modification of Michael Eager's code to migrate ICS from KDE 4.x to KDE 4.x. (1.89 KB, text/plain)
2009-05-02 23:36 UTC, fischer-michael
Details
Test case showing UTC bug (528 bytes, text/plain)
2010-03-07 17:10 UTC, fischer-michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Wittenburg 2008-06-28 17:07:43 UTC
Version:            (using KDE 4.0.83)
Installed from:    Debian testing/unstable Packages

There is some inconsistency in korganizer how time zones are handled: An appointment that appears at the correct local time in the calendar view is displayed with times in UTC on mouse-over, in the context view (left below the month view) and when editing. Further, the UTC times are also displayed in the "Upcoming Events" area of Kontact's summary view.

The expected behavior is that time zones are handled consistently matching the setting in Configure Calender -> Date & Time -> Timezone (which is set to Europe/Berlin, as opposed to UTC, in my case).
Comment 1 Christophe Marin 2008-06-28 17:39:39 UTC
Could you please export one of the bugged entry ? (right click on the event, send as Ical file) to my email address please (kropx77 at gmail.com).

Comment 2 Georg Wittenburg 2008-06-28 18:17:57 UTC
Done. If it helps: This entry has been generated before I switched KDEPIM to 4.x, so maybe it's a question of how korganizer 4.x handles data from 3.x.
Comment 3 Christophe Marin 2008-06-28 18:20:20 UTC
Thank you, I'm looking for the reason.
Comment 4 Christophe Marin 2008-06-29 02:00:46 UTC
ok so. The event you sent me doesn't mention any timezone which may explain why you see the event as UTC (I have anonymized it) :

BEGIN:VCALENDAR
PRODID:-//K Desktop Environment//NONSGML libkcal 3.5//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
DTSTAMP:20080628T161217Z
ORGANIZER;CN=Event leader:MAILTO:address@domain.tld
CREATED:20080613T082059Z
UID:libkcal-668003459.247
LAST-MODIFIED:20080613T082059Z
SUMMARY:Event
DTSTART:20080625T070000Z
DTEND:20080625T080000Z
TRANSP:OPAQUE
END:VEVENT

END:VCALENDAR

Comment 5 Christophe Marin 2008-06-29 02:10:35 UTC
Created attachment 25681 [details]
Test event

Try importing this test event and look at 2008/06/28 events in korganizer.

This event should display Europe/Paris as a timezone.
Comment 6 Christophe Marin 2008-06-29 02:14:14 UTC
The main difference between my event and yours is the presence of timezone indications :

DTSTART;TZID=Europe/Paris:20080628T200000
DTEND;TZID=Europe/Paris:20080628T230000

Comment 7 Georg Wittenburg 2008-06-29 13:56:17 UTC
The test event you sent me works fine. So I guess it's really a question of compatibility between korganizer 3.x and 4.x, as korganizer 4.x apparently assumes UTC if no timezone information is present while korganizer 3.x assumed my local timezone (Europe/Berlin).

Do you think it's possible to change this assumption in korganizer 4.x? The alternative would be to run the calender files through some script or import filter to add timezone information.

Comment 8 Allen Winter 2008-07-14 01:07:18 UTC
I double-checked, and KOrganizer from 3.5.9 and KOrganizer from 4.1 behave the same way; namely, if the date-time ends with a 'Z' it means UTC.

To make a date-time that will occur in your local timezone you want to not specify any timezone at all.

For example, DTSTART:20080625T070000 instead of DTSTART:20080625T070000Z
Comment 9 Georg Wittenburg 2008-07-19 17:20:38 UTC
Sorry for the late reply, and thanks for spending your time on this.

I'd like to reopen this bug because of the following reasons:
- I don't quite follow your argument "Z means UTC". Even if that's the case, it doesn't change the fact that the events I create with 3.5.9 appear with the wrong time in 4.0.98. Unless of course you can't reproduce this, in which case I'd have to check which part of my configuration is messed up.
- Even right now, the GUI is inconsistent. Events (created with 3.5.9) show up with UTC in the dialog but at my local timezone (with the times I originally entered) in the week view.

I still think that the following components should adjust the time of events to the local timezone (even if the time is saved in UTC) just like the week view does:
- Event dialog
- Side-bar event details
- Upcoming events in the summary view

Again, thanks for your time and effort. :)
Comment 10 Diederik van der Boor 2008-08-05 11:38:25 UTC
I find this issue very confusing too. For a moment I thought I'd missed an appointment just to figure out later it's displayed in UTC. This also happens on the "summary" panel of Kontact.

When I open the "event event" dialog, fix timezone in the event and times, it will still be displayed in UTC the next time you open the edit dialog.
Comment 11 George Goldberg 2008-09-28 23:21:57 UTC
To clarify a little: 'z' is short for "Zulu Time" which is another name for UTC. So, the calendar entry posted in comment #4 specifically has the timezone set to UTC, due to the "z" appearing after the time.
Comment 12 Sergio PR 2008-10-02 00:54:54 UTC
I have the same problem. The time of the events appears correctly in the following views: Day, Week, Working Week and List of Events, but not in Month View (it shows the UTC times).
Comment 13 Sergio PR 2008-10-02 00:56:20 UTC
Created attachment 27649 [details]
Image showing different times for the same events.
Comment 14 Sergio PR 2008-10-02 00:58:18 UTC
I forgot to say that my local time is Europe/Madrid, GMT +1:00

I'm sorry T_T
Comment 15 Craig Rust 2008-10-14 17:59:39 UTC
(In reply to comment #0)
> Version:            (using KDE 4.0.83)
> Installed from:    Debian testing/unstable Packages
> 
> There is some inconsistency in korganizer how time zones are handled: An
> appointment that appears at the correct local time in the calendar view is
> displayed with times in UTC on mouse-over, in the context view (left below the
> month view) and when editing. Further, the UTC times are also displayed in the
> "Upcoming Events" area of Kontact's summary view.
> 
> The expected behavior is that time zones are handled consistently matching the
> setting in Configure Calender -> Date & Time -> Timezone (which is set to
> Europe/Berlin, as opposed to UTC, in my case).
> 

I am also having a similar problem when switching from week to month view in Calendar.  If it is of any interest to anyone that is actively tackling this bug, I currently have both 'broken' and normal entries.  I can provide these to whoever is interested.  
Comment 16 Hans Gunnarsson 2008-10-17 12:06:26 UTC
I have the same behavior as #12
We are using Kolab as our groupware server, with KDE 4.1.2 and Korganizer 4.1.0 on OpenSuSE 11.0
Comment 17 Tim Holy 2008-10-23 17:23:21 UTC
There's a conversion script in-progress at https://bugs.launchpad.net/ubuntu/+source/kdepim/+bug/286567
(See the _final_ version of the migrateics.rb script, or at least the one posted no earlier than Oct 23, 2008.)

This script will go through your std.ics calendar file and convert all your appointments to your local timezone. This seems to fix the issue.

However, it also seems to negatively affect the performance of korganizer with large std.ics files, so for the time being I don't recommend it. (Kubuntu Intrepid beta packages.)

Also, if you run it I highly recommend making a manual backup of your std.ics file first. (It makes its own backup, but doesn't check to see if it's overwriting a previous backup, and this could lead to data loss if the script is run twice.)
Comment 18 Hans Gunnarsson 2008-10-23 20:34:01 UTC
Just want to clarify. For me this occurence is not dependent on creating the appointment in 3.5.X and viewing it in 4.1.X

Any appointment I create in 4.1.X gets converted to UTC even if I create it with my timezone (Europe/Sweden).

Maybe this is because we use Kolab as backend? This also means that the script in Comment #17 doesn't help.

Comment 19 Allen Winter 2008-10-25 18:43:24 UTC
Ok, these bug occurs for any incidence that is stored in a calendar with UTC timezone.

I just committed a fix in trunk that should handle all the places mentioned in this bug report where datetimes for UTC timezone is not shown in the user's configured timezone.

I may not be able to backport these fixes to 4.1 because a change to a kdepimlibs library is required.  I'll see what I can do.

I won't close this bug for now because there might be more places that need timezone conversion that we haven't found yet.  please let me know if you find more cases.
Comment 20 James 2008-10-28 23:40:19 UTC
I'm having a similar issue with the week view giving me the correct times and in UTC format.  The month view is 4 hours off on all appointments.  However, I do use Kolab as a groupware server 2.2 and I have outlook with the konsec connector.  It appears if I add an event through kontact the correct timezone information is honored.  However, If i add an event through horde web or konsec(outlook) it seems to not recognize the format and uses UTC.  I have also seen this cause duplicate appointments.  this probably due to it not recognizing the format.  I can provide copies of appointments if you wish to view.  It seems that a lot of this has already been mentioned and similar to what I'm experiencing now.  I have 
1  KDE Version  4.1.0 (KDE 4.1.2 (KDE 4.1.2), Kubuntu packages)
1  Application  Organizer
1  Operating System  Linux (x86_64) release 2.6.27-7-generic
1  Compiler  cc
Comment 21 nola mike 2008-10-31 22:52:29 UTC
it's definitely a problem with kontact itself.  if the .ics file has the times listed in UTC (times end with "z"; this seems to be the standard across several platforms, don't know if it's the ical standard or not), calendar will display UTC times in the month view, but correctly display local time in the week/day views.  if a new event is entered through kontact, it is saved with a TZID= sub field in DTSTART/DTEND, and the local time.  i worry a bit about changing the syntax of the DTSTART/DTEND fields, but my older version of kontact on a different desktop, as well as gpe on a nokia n800 seem to parse the TZID info correctly.  lastly, kontact displays times correctly across all views if the TZID info is included in the ics file.  
Comment 22 Tim Holy 2008-11-01 11:50:31 UTC
(In reply to comment #19)
> I just committed a fix in trunk that should handle all the places mentioned in
> this bug report where datetimes for UTC timezone is not shown in the user's
> configured timezone.

Sorry for the delay in saying something important: thanks very much, Allen!

> 
> I may not be able to backport these fixes to 4.1 because a change to a
> kdepimlibs library is required.  I'll see what I can do.

It would be great to get it for 4.1, but if not, well, I look forward to 4.2.

> 
> I won't close this bug for now because there might be more places that need
> timezone conversion that we haven't found yet.  please let me know if you find
> more cases.

It might be worth checking to see if this also fixes bug 173381 that I reported. If so, that bug report could be closed.

Finally, I reported potential performance issues with timezone conversion in bug 173383. If your patch reverts kontact to saving the event in UTC, however, this performance bug probably won't be triggered.
Comment 23 Georg Wittenburg 2009-01-03 01:33:58 UTC
Created attachment 29849 [details]
Screenshot

I think this bug is mostly resolved. The only issue that remains is that the editor view of an appointment defaults to a different timezone than the one used for display (see attached screenshot).
Comment 24 nola mike 2009-01-05 01:05:56 UTC
bug is definitely still present for me, using kontact 1.8/kde 4.1.3
Comment 25 Tim Holy 2009-01-18 22:51:37 UTC
(In reply to comment #23)
> Created an attachment (id=29849) [details]
> Screenshot
> 
> I think this bug is mostly resolved. The only issue that remains is that the
> editor view of an appointment defaults to a different timezone than the one
> used for display (see attached screenshot).
> 

I'm glad that some of the other GUI inconsistencies have been fixed. Does this fix bug 173381? If so, it could be closed.

However, the editor view has always been the most annoying aspect of this bug for me, so please do leave this bug open.
Comment 26 James 2009-02-06 22:39:18 UTC
Created attachment 31056 [details]
month view showing wrong on wrong date
Comment 27 James 2009-02-06 22:41:54 UTC
I have korganizer 4.2 rc 1 on kde enviroment 4.2.  When scheduling the month view reverts still to UTC.  As well sometimes the appointments do not even reflect on correct day.  As well as the appointment doesn't even show up under week view but will show up on incorrect day on month view.  I have sent in an attachment showing this.  the attachment shows this particular appointment in the month view and under the week view it doesn't show up at all.  If you wish for more information or if i'm beating a dead horse and the issue has already been addressed let me know.
Comment 28 Tim Holy 2009-02-06 23:18:58 UTC
James, your issues sound a lot like bug 173381. So you've answered my question above (comment #25), I guess that bug can't be closed yet (unless it was fixed between RC1 and the release).
Comment 29 Michael Eager 2009-02-09 21:06:55 UTC
Created attachment 31159 [details]
Migrate ICS from KDE 3.x to KDE 4.x

Python script to rewrite time/date in cal.ics file.
Comment 30 Michael Eager 2009-02-09 21:24:13 UTC
I've added a python script which rewrites the DTSTART/DTEND lines in an ICS
file to add time zone info and adjust the time.  This is similar to the ruby
script mentioned in comment #17, except that (1) I had problems with the ruby
and all of it's dependencies on Fedora 10, (2) it doesn't require /etc/timezone, and (3) it doesn't modify the installed std.ics calendar (which
clobbered my calendar when dependencies were missing).  

The calendar is adjusted to the local time zone, including adjusting date and time and inserting the time zone name you specify.  

The time zone name should match the current time zone.  It's not possible (as written) to adjust a calendar to a time zone other than your current time zone.  I've only tested this for my time zone.  

Example: 
  ./migrateics.py  America/Los_Angeles ~/.kde/share/apps/korganizer/std.ics >
new.ics
  cp ~/.kde/share/apps/korganizer/std.ics ~/.kde/share/apps/korganizer/std.ics~
  cp new.ics ~/.kde/share/apps/korganizer/std.ics

Comment 31 nola mike 2009-02-09 23:58:29 UTC
for me, this issue seems to have resolved with stable kde 4.2/kontact 1.4.
Comment 32 Michael Eager 2009-02-10 00:24:44 UTC
Nola -- Could be.  I'm using Fedora 10, which has KDE 4.1.4.  Updated KDE 4.2 packages are not available.  
Comment 33 nereusren 2009-02-25 03:33:37 UTC
The Month View displayed time seems to be fixed in 4.2 for me (using the ubuntu packages). Thanks for fixing this! It is the bug standing in the way of my automatic two-way calendar sync between Kontact<->GoogleCalendar<->iPhone, since Google Calendar's .ics file stores its times using the "Z" suffix.

Unfortunately, it seems to still use the UTC time/date for some things. I don't know if they should go in a different bug report or keep this one open.

For example, say I have two events on my calendar: one ("event G") at America/Chicago 3:00 imported from my Google Calendar's .ics file, and one ("event K") at America/Chicago 5:00 created with Konqueror. They will display in the wrong order on the Month View:

5:00:00 Event K
3:00:00 Event G

Presumably Event G is still being sorted based on its UTC time of 9:00.

Also, the event will appear under the date associated with the UTC time, rather than the local time. If there's an event on my Google Calendar for 21:00 America/Chicago on February 27th, in the month view it will show up under February 28th. (The tooltip and event info/summary box (on the left) display the local time and date properly.)
Comment 34 fischer-michael 2009-05-02 23:36:58 UTC
Created attachment 33306 [details]
Modification of Michael Eager's code to migrate ICS from KDE 4.x to KDE 4.x.

This script is daylight savings time aware and applies the offset from UTC in effect on the date of the event rather than the offset in effect on the date that the script is run.
Comment 35 uli9999 2009-05-15 17:59:49 UTC
Here is my experience with this issue:

My computer runs on UTC (I am not sure whether this matters), and I am in the Los Angeles timezone. I am using KOrganizer, saving events to calendar that is on disconnected IMAP (the events are stored as emails with a file kolab.xml attached).

I add an event on May 19 at 17:00 Los Angeles time to KOrganizer.

After restarting KOrganizer, the event shows up on May 20 at 17:00 in the weekly or monthly view. When I click on it, the sidebar of the event says May 19, 17:00. In the daily view, it shows up neither on May 19 nor on May 20. 
Doubleclicking on the event shows that it is saved as starting on May 20 at 0:00 UTC (which is correct, but confusing, I think - it is the same as May 19, 17:00 Los Angeles time).

So my complaints are: 
1. the event shows up wrong in the daily/monthly/weekly view.
2. when editing the event, shows up in UTC, which makes it harder to edit when I want to move it to a different time.
Comment 36 uli9999 2009-05-15 18:00:45 UTC
Here is my experience with this issue. I use KDE 4.2.3 on Opensuse 11.1 (from Opensuse's KDE4 repository).

My computer runs on UTC (I am not sure whether this matters), and I am in the Los Angeles timezone. I am using KOrganizer, saving events to calendar that is on disconnected IMAP (the events are stored as emails with a file kolab.xml attached).

I add an event on May 19 at 17:00 Los Angeles time to KOrganizer.

After restarting KOrganizer, the event shows up on May 20 at 17:00 in the weekly or monthly view. When I click on it, the sidebar of the event says May 19, 17:00. In the daily view, it shows up neither on May 19 nor on May 20. 
Doubleclicking on the event shows that it is saved as starting on May 20 at 0:00 UTC (which is correct, but confusing, I think - it is the same as May 19, 17:00 Los Angeles time).

So my complaints are: 
1. the event shows up wrong in the daily/monthly/weekly view.
2. when editing the event, shows up in UTC, which makes it harder to edit when I want to move it to a different time.
Comment 37 Sergio Martins 2009-05-15 20:36:21 UTC
(In reply to comment #35)
> After restarting KOrganizer, the event shows up on May 20 at 17:00 in the
> weekly or monthly view. When I click on it, the sidebar of the event says May
> 19, 17:00. In the daily view, it shows up neither on May 19 nor on May 20. 
> Doubleclicking on the event shows that it is saved as starting on May 20 at
> 0:00 UTC (which is correct, but confusing, I think - it is the same as May 19,
> 17:00 Los Angeles time).
>
> So my complaints are: 
> 1. the event shows up wrong in the daily/monthly/weekly view.
Fixed in trunk and for KDE 4.2.4

> 2. when editing the event, shows up in UTC, which makes it harder to edit when
> I want to move it to a different time.
Was it created with KDE3? Change it's timezone to America/LA and it should be ok.
Comment 38 Georg Wittenburg 2010-03-07 08:51:59 UTC
I can't reproduce this bug anymore, mostly for lack of pre-4.x korganizer events, and am closing this bug. Please reopen if anyone can still reproduce this.
Comment 39 fischer-michael 2010-03-07 17:10:54 UTC
Created attachment 41415 [details]
Test case showing UTC bug

This bug is alive and well, or at least some version of it is, in KOrganizer Version 4.4.  Attached file contains one event beginning beginning on Sunday, March 14, at 0100 UTC and ending at 0500 UTC.  My time zone (America/New York (EST)) is -5 hours away from UTC, so in local time, this should start on Saturday, March 13 at 8 pm and end at midnight the same day.

To witness this bug, use the KDE control panel to set your time zone to America/New York (EST), then open the attachment in KOrganizer.  Select either "Day" view or the "Week" view.  The test event will appear on *both* Saturday, March 13 *and* on Sunday, March 14.  Each shows the correct time span, 08:00 pm - 12:00 am local time.  Now go to the "Month" view.  This shows correctly that the event occurs at 08:00 pm on Saturday, March 13, but it also shows a bogus event on Sunday, March 14, at 12:00 am.

Apparently, the filter that selects *which* events to display is not correctly converting from UTC to local time, although the time conversion is done correctly when the event is actually displayed.

Workaround:  Avoid UTC times in .ics files; use local times instead.
Comment 40 Georg Wittenburg 2010-03-07 17:42:22 UTC
Reopened, given Michael's new test case above. Thanks.
Comment 41 Denis Kurz 2016-09-24 18:42:50 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of korganizer (version 5.0 or later, as part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 42 fischer-michael 2016-09-24 22:42:27 UTC
The bug I reported in Comment 39 is still with us in korganizer version 5.3.0 (QtWeb Engine).

Attachment 41415 [details] contains a calendar with one appointment "Test event" on Sunday, March 14, 2010, 1:00 AM - 5:00 AM UTC.  In terms of local time (America/New York), the above appointment begins at 8:00 PM on Saturday, March 13 and ends at 12:00 AM on Sunday, March 14.

When displayed in the day or week agenda view, the appointment displays as Saturday, March 13, 2010, 8 :00 PM - 12:00 AM, and nothing displays on Sunday, March 14.  However, in the month view, the appointment spans two days, displaying on both March 13 and March 14.

There is also a UTC conversion problem.  If one takes that same appointment but changes the ending time to 9:00 AM UTC on Sunday, March 14, 2010, it displays incorrectly as ending at 4:00 AM local time.  Since daylight savings time began at 2:00 AM on Sunday, March 14, 2010, the ending time should have displayed as 5:00 AM local time.
Comment 43 Christophe Marin 2016-09-25 09:30:38 UTC
Thanks for the feedback.
Comment 44 Bug Janitor Service 2021-01-31 18:31:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/eventviews/-/merge_requests/19
Comment 45 gjditchfield 2021-02-04 20:18:55 UTC
Git commit 2324098a8ffcf59d4e88c2c84ba2a288b8e9e783 by Glen Ditchfield, on behalf of Glen Ditchfield.
Committed on 04/02/2021 at 16:07.
Pushed by gditchfield into branch 'release/20.12'.

Fix month view's display of end-of-day instances

If a non-all-day instance extends to the end of a day, its dtEnd will
be 00:00 of the next day.  The month view incorrectly shows the instance
occurring on both days.
FIXED-IN: 5.16.3

M  +5    -1    src/month/monthitem.cpp

https://invent.kde.org/pim/eventviews/commit/2324098a8ffcf59d4e88c2c84ba2a288b8e9e783