Author Topic: Changes in local filesystem timezone handling?  (Read 2048 times)

et2511299562

  • Jr. Member
  • **
  • Posts: 11
Changes in local filesystem timezone handling?
« on: March 29, 2016, 01:32:23 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17709
    • ExifTool Home Page
Re: Changes in local filesystem timezone handling?
« Reply #1 on: March 29, 2016, 01:41:08 PM »
I tried this with both XMP and EXIF DateTimeOriginal, and it works for me with ExifTool 10.13 on OS X:

Code: [Select]
> 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

Code: [Select]
> 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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

et2511299562

  • Jr. Member
  • **
  • Posts: 11
Re: Changes in local filesystem timezone handling?
« Reply #2 on: March 29, 2016, 02:02:35 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17709
    • ExifTool Home Page
Re: Changes in local filesystem timezone handling?
« Reply #3 on: March 29, 2016, 02:14:45 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

et2511299562

  • Jr. Member
  • **
  • Posts: 11
Re: Changes in local filesystem timezone handling?
« Reply #4 on: March 29, 2016, 02:28:17 PM »
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 Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17709
    • ExifTool Home Page
Re: Changes in local filesystem timezone handling?
« Reply #5 on: March 30, 2016, 07:40:19 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).