jansorg / tom-ui

Qt5-based user interface for the tom time tracker
https://www.tomtime.dev
GNU General Public License v3.0
8 stars 2 forks source link

Fix that time entry start times are often off by + or - 2 hours in reports #110

Closed tanius closed 1 year ago

tanius commented 4 years ago

When I create a report and choose the "timelog" template for it, there will be tables showing the actual time entries of when I worked. The time entry durations derived from time entries are correct, however about half of the start times are displayed with an offset of either plus or minus two hours compared to the real time entries as seen outside of the report window.

So there is a display issue with the start times of time entries. I could not find a system in the erroneous offsets, but perhaps it has something to do with time zones?

To me, this issue happens independent of whatever other options I choose in the report generation dialog, including what type of splitting is chosen.

jansorg commented 4 years ago

@tanius There's some internal timezone conversion happening to convert from the internal UTC storage (I think) to the local timezone. This is probably missing somewhere.

jansorg commented 1 year ago

Let me know if you have an example, where this happens

tanius commented 1 year ago

Here is an example as it appears in my report using timelog entries. I have added the correct times from the timeframes list in red to any time that is off.

As you can see, it is quite random when it happens, and can affect start time, end time or both. One of the four entries was correct, the others had at least one issue. When only start time or end time is affected, the shown duration does not represent the actual duration between start and end time, obviously. It can even happen that end time is before start time if only the end time is affected.

Issue110 Example

tanius commented 1 year ago

Here is a second example. Both time entries were created by tracking just 6 seconds of time each. Both showed up correctly in the report. But then I went back and moved the start time of the 4:21 pm entry one hour into the past. After that edit, this entry has its start time off by -2 hours in the report: the edited start time should show up as 3:21 pm but does show up as 1:21 pm.

Issue110 Example2

So it seems that timezone conversion is applied wrong to edited entries at some point! That makes sense, as I had to edit my timeframes quite often to fix when I forgot to start the time tracker at the start of work.

jansorg commented 1 year ago

Should be fixed for the next update. This is only a display issue, is perfectly valid for the stored data to contain different time zones.