Incorrectly created date

Started by Andy, July 04, 2013, 03:06:49 PM

Previous topic - Next topic

Andy

Hi

I have a lage bunt of images. Some of the images have corrupt created date. Locks that some software have stored date an time two times.

It looks like this:
{code}
Date Created                    : 00-07-31 15.19 00-07-31 15.19
{/code}

Have some one a tips how to fix this?

Best regards

// Andy


StarGeek

I'm pushing my ExifTool boundaries here, but try this on a few copies of your problem files:

ExifTool "-DateCreated<${DateCreated;s/([0-9]{2}-[0-9]{2}-[0-9]{2} [0-9]{2}\.[0-9]{2}).*/$1/}" <file>

Hopefully Phil will be along with a refinement or better solution.
"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

Phil Harvey

Very odd.  If all of the dates are corrupted in the same way then StarGeek's idea should work.  You can also fill in the IPTC TimeCreated if you want:

exiftool "-datecreated<${datecreated;my @a=/\d+/g; $_=qq(20$a[0]:$a[1]:$a[2])}" "-timecreated<${datecreated;my @a=/\d+/g; $_=qq($a[3]:$a[4]:00-04:00)}" DIR

Here I have done things a bit differently than StarGeek, and am assuming that the dates are all after 2000.  For the TimeCreated I have added ":00" for seconds and a time zone of "-04:00".

The way I have done this, the command should only be run on files where the CreateDate is formatted like "YY-MM-DD hh.mm".  If you run it on other files you may get strange results.  StarGeek's pattern matching is better in this respect.

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