News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Changes in local filesystem timezone handling?

Started by et2511299562, March 29, 2016, 01:32:23 PM

Previous topic - Next topic

et2511299562

Hi,

Sometime after version 9.72, exiftool changed the way it handles the local system's timezone for filesystem times.

In my case, I used the following command to "touch" files with the DateTimeOriginal time.

exiftool -'DateTimeOriginal>FileModifyDate' <file>

This used to work as expected with the filesystem time matching DateTimeOriginal. But sometime after version 9.72, the filesystem time is now shifted the equivalent of the offset from UTC. So a file with DateTimeOriganal of 11:00 EST-5 is timestamped as 06:00 on the local filesystem.

Is this working as designed per a change in exiftool or is this a bug?

Thanks

Phil Harvey

I tried this with both XMP and EXIF DateTimeOriginal, and it works for me with ExifTool 10.13 on OS X:

> exiftool a.jpg -datetimeoriginal
Date/Time Original              : 2016:03:01 17:36:00
> exiftool a.jpg "-datetimeoriginal>filemodifydate"
    1 image files updated
> exiftool a.jpg -filemodifydate
File Modification Date/Time     : 2016:03:01 17:36:00-05:00


> exiftool a.jpg -xmp:datetimeoriginal
Date/Time Original              : 2016:03:29 13:39:07-04:00
> exiftool a.jpg "-xmp:datetimeoriginal>filemodifydate"
    1 image files updated
> exiftool a.jpg -filemodifydate
File Modification Date/Time     : 2016:03:29 13:39:07-04:00


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

et2511299562

But the timestamp reported by the filesystem (at least on Windows 7 on an NTFS filesystem) is different between the two versions:

% exiftool-9.72.exe -DateTimeOriginal file.arw
Date/Time Original              : 2016:03:29 06:29:45
% exiftool-9.72.exe -DateTimeOriginal>FileModifyDate file.arw
    1 image files updated
% exiftool-9.72.exe -FileModifyDate file.arw
File Modification Date/Time     : 2016:03:29 06:29:45+01:00
% ls --full-time file.arw
-rwxrwx---+ 1 Administrators None 24701334 2016-03-29 06:29:45.000000000 -0400 file.arw

% exiftool-10.13.exe -DateTimeOriginal file.arw
Date/Time Original              : 2016:03:29 06:29:45
% exiftool-10.13.exe -DateTimeOriginal>FileModifyDate file.arw
    1 image files updated
% exiftool-10.13.exe -FileModifyDate file.arw
File Modification Date/Time     : 2016:03:29 06:29:45+01:00
% ls --full-time file.arw
-rwxrwx---+ 1 Administrators None 24701334 2016-03-29 01:29:45.000000000 -0400 file.arw

Thanks

Phil Harvey

Interesting, but I would say that the behaviour of 10.13 is correct (01:29-04:00 is the same time as 06:29+01:00).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

et2511299562

I don't disagree that it's correct since the metadata doesn't always contain timezone information.

But it seems a little non-intuitive to have to shift the timezone for date/time operations, including geotagging, etc. If this is the new behavior, I will just take that into account.

May I suggest a new feature, something akin to -AssumeUTCOffset= which will automatically conduct all date/times calculations based on the specified offset?

Phil Harvey

ExifTool reports FileModifyDate in the system's local C time zone, whatever that is.  I have no idea why your "ls --full-time" uses a different time zone.  You are free to change this time zone, but you'll have to figure out how to do it.

The current behaviour of ExifTool shouldn't change.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).