Bug 413591 - Okular shows times in annotations with GMT instead of system timezone
Summary: Okular shows times in annotations with GMT instead of system timezone
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.8.2
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2019-10-29 12:59 UTC by Kishore Gopalakrishnan
Modified: 2019-11-02 18:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.8.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2019-10-29 12:59:01 UTC
SUMMARY
Okular saves timestamps in GMT in annotations, even though it displays time in the local timezone while initially creating the annotation.

STEPS TO REPRODUCE
1. Set your timezone to something other than GMT.
2. Open a PDF and create a 'popup note' annotation.
3. Note that the time displayed on the top-right of the popup is the current time in the local timezone.
4. Type something and exit the box by pressing 'esc'.
5. Save the PDF and wait for Okular to reload it.
6. Double-click on the recently created annotation.
7. Note that the displayed time on the top-right of the popup now matches with GMT, and not with your current timezone.

OBSERVED RESULT
Annotation is saved with GMT timestamp.

EXPECTED RESULT
Annotation timestamp should contain local time.

SOFTWARE/OS VERSIONS
Linux distro: Arch Linux
KDE Plasma Version: 5.17.1
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Output of `timedatectl`:
```
Local time: Tue 2019-10-29 16:16:14 IST
           Universal time: Tue 2019-10-29 10:46:14 UTC
                 RTC time: Tue 2019-10-29 10:46:14
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
```

My locale settings in 'Settings > Regional Settings > Formats' all correspond to 'India - English (en_IN)'.

Possible duplicate of bug 400473, but I haven't changed my timezone in years.
Comment 1 Oliver Sander 2019-10-29 13:04:30 UTC
Confirmed with current git master.
Comment 2 Albert Astals Cid 2019-10-29 13:15:29 UTC
Why is this a bug?

A time is a time.

13:14 GMT and 14:14 CET is the same time

Why is saving as GMT wrong and as CET correct?
Comment 3 Oliver Sander 2019-10-29 13:17:23 UTC
Because the GUI does not show the time zone?
Comment 4 Oliver Sander 2019-10-29 13:22:32 UTC
Longer answer: I don't care which time zone the time is saved in. But the pop-up note simply says "13:14" even though my clock said "14:14" when I wrote the annotation.
Comment 5 Christoph Feck 2019-10-29 18:00:26 UTC
Setting status correctly.
Comment 6 Nate Graham 2019-10-29 21:30:34 UTC
Yeah it doesn't matter what format the data is actually saved in, but at least for the display, it should use the user's own time zone. We invented the concept of time zones for a reason :)
Comment 7 Albert Astals Cid 2019-10-29 21:36:33 UTC
Right so the problem is not that okular saves annotations with GMT timezone, the problem is that when showing the timezone it doesn't show neither the timezone (so you can try to do the math in your head) nor shows the date in your timezone.

That's the actual problem, because you would have the same problem with files created by other PDF producers.
Comment 8 Oliver Sander 2019-10-30 09:37:39 UTC
Fix: https://invent.kde.org/kde/okular/merge_requests/57
Comment 9 Oliver Sander 2019-11-01 13:01:03 UTC
Git commit 92b7703292ab8cdef55be19524f916005b4c7dc8 by Oliver Sander.
Committed on 30/10/2019 at 09:37.
Pushed by sander into branch 'Applications/19.08'.

AnnotWindow: Always show creation time in local time

M  +1    -1    ui/annotwindow.cpp

https://invent.kde.org/kde/okular/commit/92b7703292ab8cdef55be19524f916005b4c7dc8
Comment 10 Ben Cooksley 2019-11-02 18:45:57 UTC
Git commit 3e63353bfe77ffe390d00bcd15fcca52c5369d78 by Ben Cooksley, on behalf of Oliver Sander.
Committed on 02/11/2019 at 18:36.
Pushed by bcooksley into branch 'master'.

AnnotWindow: Always show creation time in local time
(cherry picked from commit 92b7703292ab8cdef55be19524f916005b4c7dc8)

M  +1    -1    ui/annotwindow.cpp

https://invent.kde.org/kde/okular/commit/3e63353bfe77ffe390d00bcd15fcca52c5369d78