Bug 479365

Summary: Unintended Time Shift in Calendar Time Stamp settings.
Product: [Applications] digikam Reporter: Tunga <tech>
Component: Plugin-Generic-TimeAdjustAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.2.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.3.0
Sentry Crash Report:
Attachments: Dialog Box opened two consecutive times

Description Tunga 2024-01-03 18:29:21 UTC
SUMMARY
The fixed date/time option in the dialog is supposed to remember the previous date/time set.  However, every time the dialog box is opened, the set date/time shifts by a set number of hours (based on user's time zone offset).  In my case, I'm at UTC-5 so every time I open the dialog box, the fixed date/time shifts forward by 5 hours.

STEPS TO REPRODUCE
1.  Select any image. 
2.  Use Ctrl+Shift+D to open the Adjust Time dialog.  
2.  Select fixed date/time option under "Timestamp Used" 
3.  Set to Specific Date and Time of choice
4.  Check boxes to make sure timestamps are updated for the file.  
5.  Click Apply and then Close
6.  Use Ctrl+Shift+D to open the dialog box again. The fixed date/time selection will have shifted by your time zone offset.
7.  Close dialog box, reopen, the date/time will shift again by the offset. 

OBSERVED RESULT
Each time the dialog is opened, the user's system time zone offset is added to the fixed date/time.

EXPECTED RESULT
Each time the dialog is opened, the fixed date/time selection should show the last date/time used.

SOFTWARE/OS VERSIONS
Windows:  Windows 10 Home 22Hw
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version:  5.245.0
Qt Version:  6.6.0

ADDITIONAL INFORMATION
Comment 1 Tunga 2024-01-03 19:03:49 UTC
I just noticed that the same time shift appears in the "TimeStamp Adjustments" -->  "Interval".  Instead of showing the previously used settings, the dialog box automatically adds the time zone offset as an additional difference. 

Attaching screenshots of two consecutive dialog boxes, I open the box once, apply changes, and open the box again. Both options are shifted by +5 hours (since I am at UTC-5).
Comment 2 Tunga 2024-01-03 19:04:38 UTC
Created attachment 164652 [details]
Dialog Box opened two consecutive times
Comment 3 Maik Qualmann 2024-01-03 21:45:29 UTC
At first I thought this was related to a recent change of ours to do all internal date operations in UTC. But this problem is separate from this, Qt6 has changed something here, the set time is converted.

Maik
Comment 4 Maik Qualmann 2024-01-03 22:36:57 UTC
Git commit 242e00d7623f8059c7bedfc28808ba110d0bbdba by Maik Qualmann.
Committed on 03/01/2024 at 23:35.
Pushed by mqualmann into branch 'master'.

fix converting to local time in QDateTimeEdit with Qt6
FIXED-IN: 8.3.0

M  +1    -1    NEWS
M  +3    -1    core/dplugins/generic/metadata/timeadjust/timeadjustdialog.cpp
M  +1    -0    core/libs/timeadjust/timeadjustsettings.cpp

https://invent.kde.org/graphics/digikam/-/commit/242e00d7623f8059c7bedfc28808ba110d0bbdba