Bug 495506 - Preserve timezone offset Timestamp in metadata.
Summary: Preserve timezone offset Timestamp in metadata.
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Date (other bugs)
Version First Reported In: 8.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-28 22:00 UTC by Chris
Modified: 2026-04-19 06:41 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris 2024-10-28 22:00:02 UTC
SUMMARY
If metadata date tags are found originally with timezone offset, it should also stored again with the same offset. OR it should be possible to configure this globally or per tag. Including which tags should use UTC timestamps.

STEPS TO REPRODUCE
1. Start with a picture with timestamps like this:
[XMP:XMP-photoshop:Time] Date Created           : 2024:10:28 21:37:26Z
[XMP:XMP-exif:Time] Date/Time Original          : 2024:10:28 22:37:26+01:00
[XMP:XMP-xmp:Time] Create Date                  : 2024:10:28 22:37:26+01:00
[XMP:XMP-xmp:Time] Modify Date                  : 2024:10:28 22:37:26+01:00
[EXIF:ExifIFD:Time] Date/Time Original          : 2024:10:28 22:37:26
[EXIF:ExifIFD:Time] Offset Time Original        : +01:00
[EXIF:ExifIFD:Time] Create Date                 : 2024:10:28 22:37:26
[EXIF:ExifIFD:Time] Offset Time Digitized       : +01:00
[EXIF:IFD0:Time] Modify Date                    : 2024:10:28 22:37:26
[EXIF:ExifIFD:Time] Offset Time                 : +01:00
[XMP:XMP-xmp:Time] Create Date                  : 2024:10:28 22:37:26+01:00
[XMP:XMP-xmp:Time] Metadata Date                : 2024:10:28 22:37:26+01:00
[XMP:XMP-xmp:Time] Modify Date                  : 2024:10:28 22:37:26+01:00

2. Add a tag with Digikam (timestamp checkbox enabled under Metadata Behavior). Apply and sync if you have lazy sync enabled
OBSERVED RESULT

3. All offsets are stripped except in the 3 offset tags and even worse, the one TS with UTC time was also updated to local timezone:

[XMP:XMP-photoshop:Time] Date Created           : 2024:10:28 22:37:26
[XMP:XMP-exif:Time] Date/Time Original          : 2024:10:28 22:37:26
[XMP:XMP-xmp:Time] Create Date                  : 2024:10:28 22:37:26
[XMP:XMP-xmp:Time] Modify Date                  : 2024:10:28 22:37:26
[EXIF:ExifIFD:Time] Date/Time Original          : 2024:10:28 22:37:26
[EXIF:ExifIFD:Time] Offset Time Original        : +01:00
[EXIF:ExifIFD:Time] Create Date                 : 2024:10:28 22:37:26
[EXIF:ExifIFD:Time] Offset Time Digitized       : +01:00
[EXIF:IFD0:Time] Modify Date                    : 2024:10:28 22:37:26
[EXIF:ExifIFD:Time] Offset Time                 : +01:00
[XMP:XMP-xmp:Time] Create Date                  : 2024:10:28 22:37:26
[XMP:XMP-xmp:Time] Metadata Date                : 2024:10:28 22:37:26
[XMP:XMP-xmp:Time] Modify Date                  : 2024:10:28 22:37:26

EXPECTED RESULT
Offsets and timezone should be preserved.


SOFTWARE/OS VERSIONS
Windows: 11

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2024-10-29 09:03:09 UTC
First of all, it would be wrong to simply adopt the existing time offset, because this could also be wrong if you have to correct the date.

Maik
Comment 2 Chris 2024-10-29 11:08:56 UTC
@Maik

I suppose you are right.

I'm more asking for configuration options, so my scripted prep of date fields (with exiftool) are not overwritten. Especially if I do not touch the date fields. When date fields are touched, it might also be interesting to default the timezone to what was registered originally, but with ability to change it. 

A further extension could be to use of GPS coordinates as an option to auto suggest timezones (which may require a paid service).

/Chris
Comment 3 Chris 2024-10-30 09:38:20 UTC
Additional comment.

I could solve this by unchecking "Configure Digikam" -> "Metadata" -> "Behavior" -> "Write This Information to the Metadata" -> "Timestamps"

However, I had a bug with that, which caused no metadata to be updated at all inside the files. It was consistently and persistently not saving metadata to some files. But when I was writing up a bug report and made a minimum reproduction, I could not find a way to reproduce the error. So I'm still working on that, but even so... I'd still like any timestamp metadata edited in Digikam to be saved in the files, I'd just like to decide which tags to update and which tags should have timezone info and which tags should be stored in UTC time.
Comment 4 caulier.gilles 2025-04-11 22:56:59 UTC
Hi,

Refereing to your problem from the comment 3, digiKam 8.7.0 pre-release for Windows have been rebuild from scratch today
with many improvements and updates especially with the Exiv2 and ExifTool versions. Please check if the problem is reproducible.

Link to download: https://files.kde.org/digikam/

Thanks in advance

Gilles Caulier
Comment 5 Stephen Hilton 2026-03-14 06:15:33 UTC
When digikam writes xmp files, it only includes date and time in the CreateDate and ModifyDate.  It does not add the time zone offset, even if the timezone is shown in the original photograph file's EXIF data.
e.g. 
xmp:CreateDate="2020-01-01T00:01:01.69"
xmp:ModifyDate="2020-01-01T00:01:01.69"

Any application that prioritises xmp from the sidecar file over exif from the original file reads the local time without knowing the timezone offset.  If that application then assumes the time is UTC, the time that it displays will be off.
Immich is an example of such an application.  If there is no xmp file for a photo, it will read the time/date correctly from the photo's EXIF data (i.e. incorporating the timezone offset).  However, as soon as Digikam writes an xmp file, immich will display the time and date as if the time in the xmp file is UTC time.
Comment 6 Maik Qualmann 2026-04-19 06:41:15 UTC
Git commit ad5bb7d1da29dc6d90e4961d53afe79bbfa429b3 by Maik Qualmann.
Committed on 19/04/2026 at 06:40.
Pushed by mqualmann into branch 'master'.

prepare database update to add ImageTagProperties index and a timezone field
Related: bug 519125, bug 514970, bug 517889, bug 510261, bug 491608, bug 485836, bug 251357

M  +46   -1    core/data/database/dbconfig.xml.cmake.in
M  +8    -0    core/libs/database/coredb/coredbschemaupdater.cpp

https://invent.kde.org/graphics/digikam/-/commit/ad5bb7d1da29dc6d90e4961d53afe79bbfa429b3