Somehow I have corrupted Modify date being output

Started by Chip T, May 15, 2022, 12:23:45 AM

Previous topic - Next topic

Chip T

I was attempting to change the format of the time:modifydate tag being output.  Instead of "Modify Date            : <the date>", I was hoping to not include the leading "Modify Date            :"  to simplify using the output in a script.   

I attempted to modify it using:
exiftool -d +%Y-%m-%dT%H:%M:%S -n '-time:modifydate<${;modifydate}.%e' <file path>

and now the result being output is
Modify Date                     : ${;modifydate}.%e

Obviously I have not understood what I was doing (by a long shot :-[).  I have uninstalled and re-installed and the behavior did not change so I do not even know where this change is actually maintained. 

Running on MacOS 12.3.1.

How do I restore the native behavior??

Help is much appreciated.

StarGeek

When you used the -n (--printConv) option, you disabled the normal checks to make sure the date/time was in the correct format.  You have permanently changed the ModifyDate to be a string of "${;modifydate}.%e" instead of a date/time value.

Hopefully you either remember the original date/time or can copying it from another time stamp such as DateTimeOriginal.
exiftool "-ModifyDate<DateTimeOriginal" file.jpg

If you want to remove the leading tag name when listing data, you can use either the -s3 (-short3) option or the -p (-printFormat) option.

The -d (-dateFormat) option and the -n (--printConv) option are mutually exclusive.  The first is a print conversion (PrintConv) to change the format of the date/time, while the -n option is the disabling of any PrintConv.
* 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).

Chip T

I am using copies of a few photos to learn how to use ExifTools, just in case something bad happens.  Planning ahead paid off. I will get the date repaired.   

Thanks very much for the reply and assistance!

blue-j

Not sure, but maybe you needed the -P switch?

-P          (-preserve)          Preserve file modification date/time

-J

StarGeek

The -P (-preserve) option saves the FileModifyDate, which can't really be corrupted in this fashion.  Not without really messing up the drive.

In this case it was the embedded ModifyDate (probably the EXIF one) that was forcibly changed with the -n (--printConv) option.
* 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).

Phil Harvey

Quote from: Chip T on May 15, 2022, 01:40:50 PM
I am using copies of a few photos to learn how to use ExifTools, just in case something bad happens. Planning ahead paid off.

ExifTool also planned ahead by preserving the original file with "_original" added to the name.

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