Main Menu

Date offset

Started by smiley1081, June 14, 2011, 05:25:28 AM

Previous topic - Next topic

smiley1081

After changing the batteries in my camera, I forgot to check the date, and now a lot of my photos have a Taken date of 1996.

How do I compute the Shift amount in ExifToolGUI, without resorting to trial and error (my current method)?

As an example, 1996:01:08 00:15:00 must turn into 2011:05:02 15:01:00.

Thanks
       Emilio

Phil Harvey

Hi Emilio,

Unfortunately ExifTool won't do the math for you:

  2011:05:02 15:01:00
- 1996:01:08 00:15:00
---------------------
=   15:03:24 14:46:00


So the shift is "-alldates+=15:03:24 14:46:00".

The trickiest part is the variable days in a month.  Here you are going from Jan 8 to May 2.  It is 3 months from Jan 8 to Apr 8, then April has 30 days so it is an additional 24 days to get to May 2.

- 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 ($).

smiley1081

Quote from: Phil Harvey on June 14, 2011, 07:39:48 AM
Hi Emilio,

Unfortunately ExifTool won't do the math for you:

  2011:05:02 15:01:00
- 1996:01:08 00:15:00
---------------------
=   15:03:24 14:46:00


So the shift is "-alldates+=15:03:24 14:46:00".

The trickiest part is the variable days in a month.  Here you are going from Jan 8 to May 2.  It is 3 months from Jan 8 to Apr 8, then April has 30 days so it is an additional 24 days to get to May 2.

- Phil

I have tried that with EXIFToolGUI, and the Taken date went to 1997:04:09 16:37:48...

Phil Harvey

Wow.  That is odd.  I would be surprised if ExifToolGUI changes the time shift string, but I tried this from the command line and it worked as expected.

Maybe Bogdan has an idea of what could be happening here.

- 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 ($).

smiley1081

I tried with 200 years, and it went from 1996 to 2013...

Phil Harvey

That's 200 months, so your years are being interpreted as months.  Somehow the formatting of your time shift string is wrong or is being changed by the GUI.

Are you using "YYYY:MM:DD HH:MM:SS" format?

- 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 ($).

BogdanH

Hi,

My tryout:
First I have set DateTime's of photo to: 1996:01:08 00:15:00 (Emilio's value). Then I have used GUI's option Exif:DateTime shift, where I have set Shift amount to: 0015:03:24 14:46:00 (Phil's value) and got resulting DateTime values: 2011:05:02 15:01:00 -that's desired value.
Needless to say, that for all metadata modification, GUI uses ExifTool only. Of course, there could some bug when GUI passes values toward ExifTool -but after my tryout, that's not the case.

Bogdan

smiley1081

#7
Quote from: Phil Harvey on June 14, 2011, 10:33:51 AM
Are you using "YYYY:MM:DD HH:MM:SS" format?

In the windows preferences? The Italian locale only offers me "-", "/" and "." for the date separators, not ":"...

I have tried again:
The parameters:

The result:

The original file and the result file:
http://web.mclink.it/MC4187/F1060025.JPG
http://web.mclink.it/MC4187/F1060025b.JPG

Phil Harvey

You must use colons, not decimals to separate the date/time fields.
...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 ($).

smiley1081

Quote from: Phil Harvey on June 15, 2011, 07:06:13 AM
You must use colons, not decimals to separate the date/time fields.

Maybe, but I CANNOT change the decimals to colons, I can only touch the digits.

They are probably put there by the Italian locale, and not modifiable.

Phil Harvey

I understand now, sorry for being so dense.  Bogdan should fix this in the GUI, but it should work with "/" as a separator in exiftool.  "-" and "." won't work because they are part of decimal numbers.  (like "-1.5" for example)

- 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 ($).

smiley1081

Ok, I'll wait for news from Bogdan...

Thanks!

BogdanH

#12
Hi,
Yes, now I can see the problem -thank you for screenshot. And your guess is right: a fixed "mask" is used for Shif amount field (to prevent user for entering wrong values on wrong position).
Now, this "mask" is by default related to PC local regional setting. But I've modified it to keep ":" as separator regardless of local DateTime format settings. And here (Windows7), it works that way: I've tried various regional settings (incl. Italy) and I always get "0000:00:00 00:00:00" displayed.
Ok, you have proved, it doesn't always work as it should... and right now, I have no idea where the problem is in GUI. That is, I will/must find some solution, but I can't make no promise when. Thus, if you're in hurry, try with ExifTool direct option... Select file(s) you wish to modify and use following command (for example):
-Exif:DateTimeOriginal+="0015:03:24 14:46:00"

Question:
What about if you click on edit Exif (button [ ^ ] below Exif button)? The Main tab there also contains DateTime fields... how do these appear?

Bogdan

smiley1081

Quote from: BogdanH on June 15, 2011, 02:34:40 PM
Question:
What about if you click on edit Exif (button [ ^ ] below Exif button)? The Main tab there also contains DateTime fields... how do these appear?

Not really promising:


BTW, I am using XP SP3.

BogdanH

#14
Thank you for screenshot. WinXP is fine -I've used GUI on XP for very long time.
Now it's my turn to find the reason for this.

Notice: Without going into details... I have localized "troublemaker" inside GUI and have (hopefully) corrected the problem. I won't post update right now, because I would like to do some further tests (goes slow because there are so many different local regional settings) -but it seems promising.

Anyway, to be able to continue using GUI normally, just set Time format to HH:mm (that is, choose colon as separator) in your PC regional settings and everything should be fine -no need to change date separator.

Bogdan