ExifTool Forum

ExifTool => Newbies => Topic started by: Chip T on May 15, 2022, 12:23:45 AM

Title: Somehow I have corrupted Modify date being output
Post by: Chip T on May 15, 2022, 12:23:45 AM
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.
Title: Re: Somehow I have corrupted Modify date being output
Post by: StarGeek on May 15, 2022, 01:01:27 AM
When you used the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv), 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 (https://exiftool.org/exiftool_pod.html#s-NUM--short) or the -p (-printFormat) option (https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat).

The -d (-dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) and the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) 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.
Title: Re: Somehow I have corrupted Modify date being output
Post by: 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. I will get the date repaired.   

Thanks very much for the reply and assistance!
Title: Re: Somehow I have corrupted Modify date being output
Post by: blue-j on May 15, 2022, 01:53:47 PM
Not sure, but maybe you needed the -P switch?

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

-J
Title: Re: Somehow I have corrupted Modify date being output
Post by: StarGeek on May 15, 2022, 02:07:16 PM
The -P (-preserve) option (https://exiftool.org/exiftool_pod.html#P--preserve) 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 (https://exiftool.org/exiftool_pod.html#n---printConv).
Title: Re: Somehow I have corrupted Modify date being output
Post by: Phil Harvey on May 16, 2022, 03:12:24 PM
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