Bug 484708 - Images.modificationDate value in the db is incorrect
Summary: Images.modificationDate value in the db is incorrect
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Files (show other bugs)
Version: 8.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-29 12:08 UTC by guenael
Modified: 2024-03-29 16:46 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description guenael 2024-03-29 12:08:34 UTC
SUMMARY
. On Windows 10, using 8.3
. In the SQLite db, Images.modificationDate value is stored in this format "2024-03-29T10:48:44.011Z"
. If I understand rightly the ISO 8601 standard, the final Z without offset means UTC.
. But Digikam stores the modification date as local time and adds "Z" at the end without taking account of the local time.

STEPS TO REPRODUCE
1. If your local time is not UTC, add or edit a caption of an image
2. Check of value Images.modificationDate field in the db (I use DB Browser for SQLite)

OBSERVED RESULT
The value is a string which value is local time of that image, plus "Z" at the end

If you need an extra confirmation, change the timezone of your computer in the Windows settings, edit the caption and look at the field value.

EXPECTED RESULT
That value should be in UTC, taking account of the local timezone.


SOFTWARE/OS VERSIONS
Windows: 10

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2024-03-29 12:24:44 UTC
This behavior is currently intended. Due to a bug in Qt6 that extremely slows down local date calculations, we treat the local time internally as UTC timespec.
The bug will be fixed in Qt-6.6.2, but we may keep UTC internally as it is generally faster for date operations.

Maik
Comment 2 Maik Qualmann 2024-03-29 15:43:10 UTC
Git commit b10b9a5478553d7348c54a35072f4da9b2058b3c by Maik Qualmann.
Committed on 29/03/2024 at 15:42.
Pushed by mqualmann into branch 'master'.

store QDateTime with local timespec in the DB
FIXED-IN: 8.4.0

M  +1    -1    NEWS
M  +41   -9    core/libs/database/coredb/coredb.cpp
M  +1    -1    core/libs/database/haar/haariface.cpp
M  +1    -0    core/libs/database/haar/haariface_p.h
M  +3    -3    core/libs/database/thumbsdb/thumbsdb.cpp

https://invent.kde.org/graphics/digikam/-/commit/b10b9a5478553d7348c54a35072f4da9b2058b3c
Comment 3 guenael 2024-03-29 16:46:09 UTC
Thanks for your super-quick reaction!