Need to change dates/times but can't seem to get it right

Started by PhilBurton, December 24, 2019, 07:09:39 PM

Previous topic - Next topic

PhilBurton

I have an unusual date/time skew issue.  The clock backup battery in my camera got loose, and so every time I turned on the camera it was reset to 2007:00:00 00:00:00.  I took a group of photos in April, 2017, on various dates on a business and vacation trip.  I have lots of photos that were timestamped 2007/01/01 and 2007/01/02. 

I want to change all dates to the proper 2017 dates and times before I import these photos into Lightroom.  I have tried various variations of this command, but none of them succeed.

c:exiftool  -AllDates=2007:04:16+12:40:04 -T
c:exiftool  "-AllDates=2007:04:16+12:40:04" -T
c:exiftool  -AllDates="2007:04:16+12:40:04" -T 

Each run results in the --System-- FileModifyDate, FileAccessDate, and FileCreateDate being the current system date and time, in my case 2019/12/25 (because I have timeshifted my system to the timezone where I took the photos, as a sanity check between the subjects and the time of the photo.)

However, using EXIFToolGUI, I can see that the dates in --IFD0-- and --ExifIDF-- are properly changed.

So what am I doing wrong?


My computer experience goes back to the days of CP/M, DOS 2.1, and UNIX System III, so I'm not afraid of a command line, but my command-line skills are rusty now that I use Windows.


StarGeek

If you check the Shortcut tag page, you'll see that AllDates is a shortcut for only three tags, DateTimeOriginal, CreateDate, and ModifyDate.  If you want to set FileCreateDate and FileModifyDate, you'll have to set then specifically.  FileAccessDate is not a tag that exiftool can change (see Extra Tags) but it usually is automatically set to one of the other two OS time stamps (can't remember which atm).

See FAQ #5 for how to format time stamps for exiftool.
"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

PhilBurton

Stargeek,

Thanks very much.  As a new user to exiftool's command line options and to all the different date-related EXIF tags, your explanations helpful and to the point.   I appreciate your response. 

Can you suggest to Phil Harvey that he create another tag that includes FileCreateDate, FileModifyDate and AllDates.

I wasn't aware that FileAccessDate is read-only, at least in Windows, but I guess I can live with that, as long as I can change the other dates.

Phil

StarGeek

If you set up an example.config file file, you can create one yourself.

Save the file linked above as .exiftool_config in the same directory as exiftool.exe.  Open the file in a text editor like notepad (not a word processor).  Find this section right near the top of the file
%Image::ExifTool::UserDefined::Shortcuts = (
    MyShortcut => ['exif:createdate','exposuretime','aperture'],
    MyAlias => 'FocalLengthIn35mmFormat',
);


Add a new line with the name of your short cut and the tags you want to include.  For example:
%Image::ExifTool::UserDefined::Shortcuts = (
    MyShortcut => ['exif:createdate','exposuretime','aperture'],
    MyAlias => 'FocalLengthIn35mmFormat',
    MyAllDates => ['FileCreateDate', 'FileModifyDate', 'AllDates'],
);


You can now set FileCreateDate, FileModifyDate , and all the tags included in AllDates in one go.
exiftool  -MyAllDates="2007:04:16 12:40:04" /path/to/files

You can even make shortcuts to save on typing.  For example, rather than type out HierarchicalSubject every time, I made a shortcut HS
    HS=> 'HierarchicalSubject',
"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

Yes, the way to do this is with user-defined tags as StarGeek suggests.

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