Bug 250865 - scheduling information incorrect when local time zone changes
Summary: scheduling information incorrect when local time zone changes
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 major (vote)
Target Milestone: 3.9   Edit
Assignee: Sam Davis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 330244 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-14 19:38 EDT by Steffen Pingel CLA
Modified: 2014-05-02 19:10 EDT (History)
3 users (show)

See Also:


Attachments
tasklists.png (119.93 KB, image/png)
2012-03-19 16:45 EDT, Sam Davis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2008-10-14 19:38:55 EDT
The date stamps used to store scheduling information in the task list use local timestamps, e.g.:

 ScheduledEndDate="2007-10-30 23:59:59.999 PDT" ScheduledStartDate="2007-10-30 00:00:00.0 PDT"
 
If the local time zone changes the date range would span two days instead of one specific day.
Comment 1 Sam Davis CLA 2011-11-09 22:19:26 EST
I do not think storing the dates in UTC will solve anything as they are already stored with their timezone and converted to the local timezone. A specific day in Vancouver does not line up with a specific day in Tokyo no matter how you represent them; converting to UTC only changes the units. We need some way of converting between day ranges in different time zones. I think the correct solution is for the day date bins to include any task scheduled for a specific day (in any time zone) where that day's midpoint falls within the range of that bin.

This will mean that if I am in Tokyo and I schedule a task for Tuesday, when I go to Vancouver (and restart Eclipse so that the JVM updates its default time zone), the task will show under Monday, which is probably correct because Vancouver is more than 12 hours behind Tokyo.

I have a working implementation of this. I will attach a patch once I have got egit back into a sane state (hopefully tomorrow).
Comment 2 Sam Davis CLA 2012-03-19 16:44:27 EDT
Ignore my previous comment.

This bug causes quite a bad bug where tasks scheduled while travelling do not show up in the scheduled presentation at all. We can mostly fix that in the UI by just being more lenient about which tasks to show in a bin. We can determine what day a task was scheduled for based on the scheduled date (a 24 hour period) and the current time zone, and we can simply show the task in the corresponding bin.

I have implemented this and it works except for the UTC+12 to UTC+14 timezones, which we cannot distinguish from UTC-12 to -10. This only deals with scheduled dates but it would probably be straightforward to do the same thing for due dates. Here is a review: http://review.mylyn.org/#change,378
Comment 3 Sam Davis CLA 2012-03-19 16:45:51 EDT
Created attachment 212877 [details]
tasklists.png

Here is a screenshot showing the same task list in different time zones. I created a bunch of tasks named according to their schedule date and time zone. You can see that it works well except for the tasks scheduled for UTC+13. I'll add a comment to the review giving more detail about that.
Comment 4 Steffen Pingel CLA 2012-03-20 09:01:08 EDT
Thanks for the change, Sam. Can you add a bunch of test cases for the different time zones?
Comment 5 Sam Davis CLA 2012-03-21 13:54:57 EDT
I will look into this next week.
Comment 6 Steffen Pingel CLA 2012-05-23 16:59:43 EDT
Sam, are you planning to do this for 3.8?
Comment 7 Sam Davis CLA 2012-05-23 17:13:48 EDT
Yes, I am planning to do this early next week.
Comment 8 Sam Davis CLA 2012-05-31 20:43:33 EDT
I have added tests and also fixed due dates. The problem for due dates is not as serious - due tasks still show up in the task list, they just show up a day early if you travel West - because they are represented as the start of a day rather than the whole day. But I thought it would make sense for due and scheduled dates to have the same behaviour, that is, that tasks never change date bins as the result of a time zone change.

5990: NEW - bug 250865: scheduling information incorrect when local time zone changes  https://bugs.eclipse.org/bugs/show_bug.cgi?id=250865 [I0ae81f95]
https://git.eclipse.org/r/#change,5990
Comment 9 Mik Kersten CLA 2012-06-18 13:43:19 EDT
Steffen: Assuming that 3.8 goes with this defect, should we make this a "know issue"?  The bahavior is bad enough that I think we need to inform users of it, and instruct them to not switch their timezones.
Comment 10 Mik Kersten CLA 2012-08-03 11:06:14 EDT
This just happened to me again on planning and possibly other tasks.  This bug is really bad when it happens. 

Steffen: Have we added a known issue on this?
Comment 11 Sam Davis CLA 2013-05-07 19:52:40 EDT
The fix has been merged. Should we leave this open to verify it?
Comment 12 Steffen Pingel CLA 2013-05-08 03:15:26 EDT
Thanks Sam! Let's close it and mark as verified if it works as intended and reopen if it doesn't.
Comment 13 Leo Dos Santos CLA 2014-05-02 19:10:46 EDT
*** Bug 330244 has been marked as a duplicate of this bug. ***