Invalid time string when shifting DateTimeOriginal

Started by perforsberg, August 20, 2022, 08:47:15 AM

Previous topic - Next topic

perforsberg

Hi,

I get this error message when trying to change creation date on some jpg images. It works for all images, except those with original time stamp where seconds is one digit, e.g 10:30:05. It looks like exiftool think that zero is a white space. Then I get this error message:

"Warning: Invalid time string (2022:07:11 10:30: 5) when shifting DateTimeOriginal".
I´m using this terminal command:

exiftool "-DateTimeOriginal-=43:01:0 0:0:0" -IPTC:Caption-Abstract="My description" "-filemodifydate<datetimeoriginal" -overwrite_original /Path/To/My/Folder
I guess it´s a bug?

I´m on MacOS 12.5.1 with exiftool 12.44

Alan Clifford

Is "2022:07:11 10:30: 5" the original datetimeoriginal?  That is, with the space?

greybeard

Alan is probably correct - you have incorrectly formatted dates in your images.

exiftool may be able to fix them up - something like:

exiftool "-DateTimeOriginal<datetimeoriginal" xxx.jpg
(Test thoroughly before you try on your production files)

StarGeek

Quote from: greybeard on August 20, 2022, 10:01:25 AMexiftool "-DateTimeOriginal<datetimeoriginal" xxx.jpg

Works correctly here
C:\>exiftool -G1 -a -s -DateTimeOriginal y:\!temp\Test4.jpg
[ExifIFD]       DateTimeOriginal                : 2022:07:11 10:30: 5

C:\>exiftool -P -overwrite_original "-DateTimeOriginal<DateTimeOriginal" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -DateTimeOriginal y:\!temp\Test4.jpg
[ExifIFD]       DateTimeOriginal                : 2022:07:11 10:30:05
"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