ExifTool Forum

ExifTool => Newbies => Topic started by: panicnow on September 02, 2018, 06:24:01 AM

Title: Date change errors
Post by: panicnow on September 02, 2018, 06:24:01 AM
I'm struggling to understand a problem I'm having changing dates/times.

Having forgotten to change the time on two cameras for a recent trip abroad I thought I'd use Exiftool to correct the times.

I used the same syntax for a Nikon and a Canon camera. Everything went as expected on the Nikon but some files ended up with incorrect dates and times for photos from the Canon.

The command I used was:
exiftool "-alldates-=7:36:28" "-DaylightSavings=On" "-Timezone=+00:00" "-filemodifydate-=7:36:28" "-filecreatedate-=7:36:28"

The odd time is to correct an error with the time on the camera at the same time as the timezone. The original timezone was +9 (no daylight saving), and it should have been +0 with daylight saving (BST).

For most files it worked well but for some files new date was 8 days 1 hour too late. I've not been able to figure out why but running the command on the same set of files multiple times it is always the same files which have the wrong time. The problem is with the file create date and modify date. I'm not too worried about the modified date but would like to get the create date correct.

Can anyone give me any tips about where to start looking for the cause of the problem?

I'm doing this on Mac OS X.

Not directly related to the question but can someone tell me what the create time "2018:08:11 00:26:24+09:00" should mean? I've looked at this file on a machine with the timezone set to +9:00 and +0:00 with daylight saving. On both machines the time is identical with the number of hours after the "+" different. Surely that should only be the case if the time is UTC and the number at the end shows the offset, but the time is the "local" time according to the camera settings at when the photo was taken.
Title: Re: Date change errors
Post by: Hayo Baan on September 03, 2018, 02:14:44 AM
Quote from: panicnow on September 02, 2018, 06:24:01 AM
(note: on a Mac you can't directly set -filecreatedate,

It is now writable on Mac.

- Phil

DARNIT!  Sorry Hayo, I must have hit Modify instead of Quote when I replied, because I managed to overwrite your response. :(  :(  :(
Title: Re: Date change errors
Post by: Phil Harvey on September 03, 2018, 05:31:46 PM
Sorry for messing up Hayo's post. :(

I imagine that he said that the FileCreateDate and FileModifyDate may not be reliable because they may be changed when the file is written.  If the DateTimeOriginal is correct (and in the same time zone as the system), then you could do this to set these properly:

exiftool "-filecreatedate<datetimeoriginal" "-filemodifydate<datetimeoriginal" DIR

- Phil
Title: Re: Date change errors
Post by: panicnow on September 04, 2018, 05:47:41 AM
Thank you both for the replies.

Quote from: Phil Harvey on September 03, 2018, 05:31:46 PM
If the DateTimeOriginal is correct (and in the same time zone as the system), then you could do this to set these properly:

exiftool "-filecreatedate<datetimeoriginal" "-filemodifydate<datetimeoriginal" DIR

The DateTimeOriginal is correct (local time where the photo was taken) but not the same as the system time. As a test, I ran the command on a copy of the directory anyway and it worked.

Interestingly, unlike the original command, this time every file gave the warning "This tag is Windows only in File:FileCreateDate (ValueConvInv)" but after running it Finder reports the correct create date as well as modify date.

Thanks for the help

Title: Re: Date change errors
Post by: Phil Harvey on September 04, 2018, 08:06:55 AM
If you get an error saying "This tag is Windows only", then you must be using an older version of ExifTool somehow.  (Earlier than version 10.91)

- Phil
Title: Re: Date change errors
Post by: panicnow on September 08, 2018, 01:46:31 AM
Quote from: Phil Harvey on September 04, 2018, 08:06:55 AM
If you get an error saying "This tag is Windows only", then you must be using an older version of ExifTool somehow.  (Earlier than version 10.91)

Ah yes. I hadn't checked but now see I was using 10.90

Thanks