Batch update only the date component of a tag and not its time

Started by JohnL404, October 15, 2016, 02:48:10 PM

Previous topic - Next topic

JohnL404

I've spent hours today searching so I apologize if this has already been asked and answered elsewhere in the forums.

I'm trying to use ExifTool to batch update files with only the date component of a particular tag (ex: ModifyDate) but it's always requiring me to pass in time to the parameter.  For example, I want to set all files in the "2005-01-01" folder to 1/1/2005 but I do *not* want to touch their time stamps.  I've tried:

1. Using -ModifyDate="2005:1:1" but that didn't work.  It warns me the date/time stamp is incorrect.
2. Using -ModifyDate="2005:1:1 0" but that didn't work either.  It accepts the command but updates all of my date/time stamps to 1/1/2005 00:00:00.00-06:00".

Can someone please help?  Thanks in-advance!

StarGeek

Yep, it's been answered before, but each situation is slightly different, so it can be hard to search on.

Basically, what you want to do is copy the tag into the same spot with changes.  So instead of the assignment = operation, you want to use tag redirection <.

Then you want to remove the date part of the tag.  In your case that would be ${ModifyDate;s/.* //}.  That will take everything in the ModifyDate tag up to and including the first space and remove it, leaving only the time part.

So your command would looks something like:
exiftool "-ModifyDate<2005:1:1 ${ModifyDate;s/.* //}" TargetFile
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

JohnL404

That worked perfectly -- thank you so much for the help, StarGeek!  :)