Local dates and Time Zones

Started by sdb, May 05, 2022, 02:17:26 PM

Previous topic - Next topic

sdb

Handling metadata dates is very complicated and I was pleased to see that (a) a lot of work has gone into the handling of dates in iMatch, and (b) this is well documented.  I have read How IMatch uses Date and Time Information many times.

However I would like a deeper understanding before I start fixing the metadata in many files. In you documentation you use the expresion "local time" to mean the time zone of the computer running iMatch.  To avoid confusion, I will refer below to this as "iMatch-local" time. I am interested in the "local" time according to the photographer when and where the photo/video was taken - I'll call that "subject-local" time.  This is of course sometimes very different from iMatch-local, especially when a photo is taken while travelling abroad.

(1) The documentation explains how File.DateTime is filled in during import.  I have assumed (based on limited testing) that this calculation is performed once, and then the resultant DateTime does not change unless there is a change to the data associated with the file.  It does not change if the computer's local time zone changes, e.g. due to Daylight Savings coming into effect or a change in geographical location.  Please let me know if this is wrong (in which case I assume all the File.DateTime values change after DST starts and again when it stops!).

(2) If the assumption is correct, I think this means that the File.DateTime value for any given file will depend upon when and where the file is added to the database.  If I add an image the day before DST starts it will have a different File.DateTime value from a copy of the same image added to the database a day later. Is this right?

(3) Assuming this is correct, it introduces a little uncertainty in the File.DateTime value.  This probably doesn't matter in practice.  I have been wondering why this procedure of converting to iMatch-local time was adopted, instead of converting to UTC (or GMT without a time zone), which would avoid the uncertainty.  I suppose the advantage of your approach is that for most cases (where images are taken in the same geographical region as the computer locale and imported soon after taking the photo) the File.DateTime will be the same time as the photo was taken, so it would look more 'reasonable'.

(4) For presentation purposes I would like to display consistently the "subject-local" time of each file. I would expect and plan for this to be stored, with the time zone, in Date Subject Created. I would prefer to show this without any time zone, but none of the date formats in Variables allows this - if you omit the time zone the date is changed to iMatch-local.  The best I have worked out is:
{File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:DD MMM YYYY hh:mm:ssz;limitstr:20}
but of course this would not work for date formats of variable length (e.g. D MMMM YYYY).
Is there a better way?

Mario

#1
The global {File.DateTime} is calculated at the time the file enters the database or is rescanned for some reason.
It is updated when you change the date created / date subject created timestamps (or one of the other timestamps, depending on the file format).

It does not change when you change the clock on your PC or when DST comes into effect in some way.
This would be technically pretty challenging and not really that useful. You can always chose to display a metadata tag or even a variable instead of the default File.DateTime, and also use other tags for sorting.

The transformation from the native XMP date and time format into your local format in the Metadata Panel is 'live', meaning the routines used for this apply the current DST settings.
You see the native date and time format in YYYY:MM:DD HH:MM:SS format when you click into a date & time tag in the Metadata Panel.

Time-zone offsets in image are a minefield. EXIF 'partly' supports it (but not all camera vendors do), some software supports it, but not all. Some software does not deal with time-zone offsets at all, or messes up when translating between EXIF and XMP.

The know-how article in the help explains all this pretty well, I believe. And also how you control if or if not IMatch applies the local time-zone when producing {File.DateTime}.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

mastodon


sdb

Quote from: Mario on May 05, 2022, 02:30:08 PM
And also how you control if or if not IMatch applies the local time-zone when producing {File.DateTime}.
Oh wow!  So the section at the beginning of  How IMatch uses Date and Time Information that says:

IMatch manages a standard global datetime value (in local time (your time zone)) for each file in the database.

is only accurate if the Metadata2/XMP Import/Apply time-zone setting is "Yes"?

I had previously thought that {File.DateTime} was always local time, and this setting only related to XMP and only controlled what happened when adding a file (and thus causing the XMP metadata to be imported), but it applies universally whenever you change metadata (and perhaps even if the metadata you are changing is not XMP, but metadata from which iMatch maps to XMP?).

I wil change the setting to "No" and experiment to see if this fixes some issues in my workflow and doesn't have adverse effects.


Mario

QuoteOh wow!  So the section at the beginning of  How IMatch uses Date and Time Information that says:

This setting is explained in the How IMatch uses Date and Time Information help topic, under EXIF Time-zone

This setting was added because some users want it this way, some users want it the other way, and most users don't care.
It all depend on how precise you need your metadata timestamps to be. You can always use XMP metadata timestamps directly for your purposes and calculations. They may or may not have a time zone, derived or not derived from existing time-zone offsets recorded by your camera or other device. Some use the EXIF offset tags, many don't.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sdb

Quote from: Mario on May 06, 2022, 02:47:19 PM
This setting is explained in the How IMatch uses Date and Time Information help topic, under EXIF Time-zone

I think there is room for confusion here - at least I got confused, though that is probably not a good test.

First, the reference to the Apply time-zone setting is at at the beginning of the EXIF Time-zone section of the help topic.  But this setting is not specifically to do with EXIF, and some readers (e.g. me) might instead look at the setting in the IPTC and EXIF Time Zones section of Metadata2. (Maybe that is what was actually intended, because this part of the help topic is concerned with time zone offsets, not {File.DateTime} calculation. That would mean the help topic does not contain an explanation of the actual Apply time-zone setting.)

Second the Apply time-zone setting is in the XMP Import section of Metadata2, but it seems to have nothing to do with XMP or import.  At least, not exclusively.

Mario

Each help page has a feedback link at the bottom. Feel free to use it to inform me about issues, typos, missing or unclear information.
Using this link automatically enqueues your request into one of my to-do lists.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sdb