Author Topic: Request assist with changing bad date/time on a number of photos  (Read 185 times)

CarolW

  • Newbie
  • *
  • Posts: 2
  • Everything is a laughing matter.
    • Coherent Dog
Once I was okay with DOS; then learned something about Windows; now running Windows 10. Read through the info that appeared when I typed "Exiftool" (after "installing" (extracting) it. I am now out of hospital after 4 months, in considerable pain, and trying to cope with:

Bad file date on a number of photos from my Canon Powershot500 IS - maybe a low battery? I must have some 50 photos with bad date.. Everything else looks okay.

Could somebody assist me in how best to alter the bad dates? Perhaps even in batch mode?

The TIMES are accurate, but the DATE is wrong.

I seem to have trouble understanding just what best to do.

Thanks in advance.
CarolW

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2371
Re: Request assist with changing bad date/time on a number of photos
« Reply #1 on: March 01, 2019, 04:48:46 PM »
Were all the photos with the incorrect date taken on the same date?

Your basic command would be something like
exiftool "-AllDates<${DateTimeOriginal;s/^.{10}/####:##:##/}" FileOrDir
Where you replace ####:##:## with the correct date and FileOrDir with the files and/or directories to process.

Test it on a copy first to make sure it's doing what you want.  Exiftool will process whole directories at once, so I suggest separating the files by date, if they pics where taken on different dates.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

CarolW

  • Newbie
  • *
  • Posts: 2
  • Everything is a laughing matter.
    • Coherent Dog
Re: Request assist with changing bad date/time on a number of photos
« Reply #2 on: March 01, 2019, 08:38:02 PM »
Were all the photos with the incorrect date taken on the same date?

Your basic command would be something like
exiftool "-AllDates<${DateTimeOriginal;s/^.{10}/####:##:##/}" FileOrDir
Where you replace ####:##:## with the correct date and FileOrDir with the files and/or directories to process.

Test it on a copy first to make sure it's doing what you want.  Exiftool will process whole directories at once, so I suggest separating the files by date, if they pics where taken on different dates.

Thanks! I'll have to study and experiment to make sure I've understood you correctly! Will do that, and report back. By the way, the files (photos) have a number of different dates; and their folders were also misnamed by date; I renamed them to correct the dates, but there may be errors in which folder which photo got deposited. :'( I'm not happy with the Windows 10 Photo application, which usually imports okay, but has several times made wrong-date folders. It may be a while before I report back, as I'm now very slow on unfamiliar esoteric stuff!  :D

Carol
Windows 10
Exiftool 11.29
CarolW

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2371
Re: Request assist with changing bad date/time on a number of photos
« Reply #3 on: March 01, 2019, 11:16:35 PM »
If the folders have the proper date, then there is the possibility to batch replace the date with the value from the folder.  It would depend upon how the directory was named and if any of the other folders above it have numbers.

Assuming that only the directory with the date contains numbers, like c:\pics\2019-03-01, not something like c:\pics\2019\2019-03-01, then the command would be something like
exiftool "-AllDates<$Directory ${DateTimeOriginal;s/^.{10}//}" FileOrDir
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.