immich icon indicating copy to clipboard operation
immich copied to clipboard

Time offset in timeline UTC - local time

Open DeltaTango69 opened this issue 2 years ago • 10 comments

Hello,

pictures from my Sony Camera has an offset to the pictures from the mobiles. The difference is the timezone. The only difference in the exif data are that in the mobil pictures are two entrys more.

image

image

The "offset" entrys are not in the Sony pictures. Could this be the reason? Other programms only use the information from the datetimeoriginal as Local - time. Than there is no offset in the timeline.

Windows - time taken!

image

Immich - Info - one hour difference !

image

Is it possible to use only the datetimeoriginal withou offset?

Originally posted by @DeltaTango69 in https://github.com/immich-app/immich/discussions/6674

DeltaTango69 avatar Jan 31 '24 14:01 DeltaTango69

https://discord.com/channels/979116623879368755/1201824099115216957

DeltaTango69 avatar Jan 31 '24 14:01 DeltaTango69

This is an issue for DSLRs in general, and google photos even has the same issue!

Either you need to add a timezone field to the metadata of your DSLR photos, or add a default TZ to immich by setting the TZ env variable.

etnoy avatar Feb 01 '24 14:02 etnoy

I have added this env setting and with photos is working now! But now the problem is with videos. Apparently an offset is added to the UTC time.

Video was taken at 10:26 UTC - 11:26 +01 GMT. Immich shows 11:26 UTC!!!

image

Here are all times from the metadata

======== 20240120112609.mp4 [System] FileModifyDate : 2024:01:20 20:03:01+01:00 [System] FileAccessDate : 2024:02:01 17:38:31+01:00 [System] FileCreateDate : 2024:01:30 17:02:10+01:00 [QuickTime] CreateDate : 2024:01:20 10:26:09 [QuickTime] ModifyDate : 2024:01:20 10:26:09 [Track1] TrackCreateDate : 2024:01:20 10:26:09 [Track1] TrackModifyDate : 2024:01:20 10:26:09 [Track1] MediaCreateDate : 2024:01:20 10:26:09 [Track1] MediaModifyDate : 2024:01:20 10:26:09 [Track2] TrackCreateDate : 2024:01:20 10:26:09 [Track2] TrackModifyDate : 2024:01:20 10:26:09 [Track2] MediaCreateDate : 2024:01:20 10:26:09 [Track2] MediaModifyDate : 2024:01:20 10:26:09 [ItemList] ContentCreateDate : 2024:01:20 11:26:09+01:00 [XMP-xmp] CreateDate : 2024:01:20 11:26:09 [XMP-xmp] ModifyDate : 2024:01:20 11:26:09 [XMP-xmpMM] DerivedFromLastModifyDate : 2024:01:20 11:26:09 [XMP-xmpMM] IngredientsLastModifyDate : 2024:01:20 11:26:09 [XMP-xmpMM] ManagedFromLastModifyDate : 2024:01:20 11:26:09 [XMP-xmpMM] ManifestReferenceLastModifyDate : 2024:01:20 11:26:09 [XMP-xmpMM] RenditionOfLastModifyDate : 2024:01:20 11:26:09 [XMP-xmpMM] VersionsModifyDate : 2024:01:20 11:26:09

Match would be the createdate under Quicktime and XMP-xmp. Quicktime is UTC and XMP is local time. Maybe therefore is some confusion? I know that the Quicktime value should be right as UTC. When immich use this time than it would be right! image

DeltaTango69 avatar Feb 01 '24 16:02 DeltaTango69

Did you refresh metadata for the image?

etnoy avatar Feb 01 '24 17:02 etnoy

Yes of course, as described for photos is working now with the TZ entry. But for videos is now wrong.

DeltaTango69 avatar Feb 02 '24 05:02 DeltaTango69

My assumption is right - when I delete this

[XMP-xmp] CreateDate : 2024:01:20 11:26:09 [XMP-xmp] ModifyDate : 2024:01:20 11:26:09

from the metadata, then the correct UTC time from the

[QuickTime] CreateDate : 2024:01:20 10:26:09

is used.

I think the best way is to integrate in your list the

[ItemList] ContentCreateDate : 2024:01:20 11:26:09+01:00

before the createdate. Because here the TZ information is stored.

DeltaTango69 avatar Feb 03 '24 09:02 DeltaTango69

I'm also having the same issue. Pictures taken with my sony A7 (first gen) camera have a wrong time offset in immich. The image is taken at 22:14 GMT+1 (ignore that the computer clock is one minute different). When uploaded to immich via the web interface, it shows a time of 23:14 GMT+1, indicating that it added the time zone offset (+1) to the correct time of the image.

The image is attached below. This should be possible to reproduce by just uploading the image with the web interface. DSC03509

fwsmit avatar Feb 15 '24 21:02 fwsmit

For the full discussion regarding the issue on Discord

aviv926 avatar Feb 16 '24 13:02 aviv926

The link doesn't work for me. It takes me to an empty channel

fwsmit avatar Feb 17 '24 22:02 fwsmit

The link doesn't work for me. It takes me to an empty channel

You need to be a member of the server first https://discord.com/invite/D8JsnBEuKb

aviv926 avatar Feb 17 '24 22:02 aviv926

I also have a same problem, when I upload videos without timezone information, it falls to UTC timezone even though I have set the TZ environment variable.

I have added this env setting and with photos is working now! But now the problem is with videos. Apparently an offset is added to the UTC time.

namu-lee avatar Mar 08 '24 02:03 namu-lee

I think for videos the TZ variable is useless because videos with no TZ information are UTC. Normally for videos the quicktime:createdate is written with the UTC time! The error for me was that in the xmp:createdate was written the local time and in the quicktime:createdate the UTC time, what is right! Unfortunately exiftool delvivers first the xmp metadata and ignored the quicktime metadata. As I deleted the xmp data the video was shown with the right time!

DeltaTango69 avatar Mar 08 '24 18:03 DeltaTango69

Solved by myself

DeltaTango69 avatar Apr 01 '24 07:04 DeltaTango69

How did you solve the problem? I'm still experiencing the problem, so I don't think the issue should be closed until it's fixed in Immich

fwsmit avatar Apr 01 '24 15:04 fwsmit

See my post before. The exif data was not clear

DeltaTango69 avatar Apr 01 '24 17:04 DeltaTango69

Same issue here, also was entirely user error and not knowing QuickTime tags are all UTC. The EXIF tag does not support timezones in the EXIF:DateTimeOriginal or Exif:CreateDate, and XMP times are expected to have the timezone offset in it, and will override most of those things.

MikNolhan avatar Jun 04 '24 21:06 MikNolhan