Align date/time for specific files

Started by quicky, October 29, 2018, 07:43:43 PM

Previous topic - Next topic

quicky

Hi all,

I'm desperately looking for a solution for the following issue:

During the past years of taking pictures I sometimes forgot to set the right timezone and of course I quickly found a GUI (geosetter) which was using ExifTool to fix this issue. Now, after some years I saw that the tool only changed the "Date/Time Original" entry of the file. My windows-explorer and several other tool still show the wrong setting. As I have more then 200k images I can't manually fix this and I also don't recall which images are affected so I'm looking for a two-step approach:

1. Identify the files where the most common date-entries (I think those are "Create Date", "Modify Date" and maybe "File Creation Date/Time"?!) differ from "Date/Time Original"
2. Write the "Date/Time Original" value into the other date fields

I was really looking a lot in this forum before I decided to post here but I really couldn't find a solution that fixed my issue...

Thanks a lot for your support!

Best regards,

Oliver

Phil Harvey

Hi Oliver,

ExifTool can definitely do that.  The basic command could look like this:

exiftool -if "$createdate ne $datetimeoriginal" "-createdate<datetimeoriginal" DIR

But the -if condition may be as complex as you want, and you may copy as many tags as you want in the same command.

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

quicky

Hi Phil,

Thank you so much for the syntax, that was exactly what I was looking for. One final question: Is there any best practice that you would recommend regarding which time/date fields should be aligned. I mean in theory each field could store an individual entry however which fields would you say should reflect the time/date when the image was taken? As I mentioned before, right now there's only one entry which shows the right time. When I'm updating my files, which fields would you include in that update?

Thanks and best regards,

Oliver

StarGeek

Quote from: quicky on October 30, 2018, 12:39:50 PM
Is there any best practice that you would recommend regarding which time/date fields should be aligned.

For completely digital, unaltered images, such as those taken from a digital camera (not a scanned photo), then DateTimeOriginal, CreateDate, and ModifyDate should all be the same.  DateTimeOriginal is the "date and time whenthe original data was generated".  CreateDate (also called DateTimeDigitized) is the "date and time when the image was stored as digital data".  And ModifyDate is the "date and time when the file was last modified".  So obviously, when you take a digital picture, all three happen at the same instant.

If, for example, you scan an old family photo, then CreateDate would be the time you scanned the photo and DateTimeOriginal would be the time the original photo was captured on film.  But this is usually too technical for most people to really worry about.

You can use the AllDates shortcut to write to all three of these tags at the same time.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype