ExifTool Forum

ExifTool => Newbies => Topic started by: joeychan on June 13, 2025, 06:31:27 AM

Title: Changing only the Date Created and not the Date Modified
Post by: joeychan on June 13, 2025, 06:31:27 AM
Hello,

I am new to the Exif tool, and I am not 100% sure I I understand how the command line abbreviations and code are supposed to be written. I tried experimenting it but it failed.

Like many users, I need to back up my photos from my phone to an external hard drive.  In the process, my computer gave all the files new date created and date modified dates as part of the file information (not the EXIF data). Over 30000 photos now all show up in the same day on my hard drive, which uses the date modified entry to organize the photos in the gallery.

Is there a way to have this tool pick up the date from the EXIF and then re-write the date created ONLY and not the date modified in the file information? I found the full command line of "exiftool "-filemodifydate<datetimeoriginal" "-filecreatedate<datetimeoriginal" DIR" in this forum, and when I tested the full command it worked fine. But when I thought I should delete the part "-filemodifydate<datetimeoriginal" for what I wanted to achieve, the output goes "xxx files weren't updated due to errors". If you could show me exactly what to write correctly in the command line, that would be truly helpful.

Thank you!

Joey
Title: Re: Changing only the Date Created and not the Date Modified
Post by: Phil Harvey on June 13, 2025, 10:42:31 AM
Hi Joey,

You don't mention what system you are using?  Linux doesn't have FileCreateDate, and on Mac you need to add an xcode tool to be able to write this (install with the command "code-select --install").

But it would help to know what the errors were.  This command should work as long as FileCreateDate is writable on your system and DateTimeOriginal exists in the file:

exiftool "-filecreatedate<datetimeoriginal" DIR

- Phil
Title: Re: Changing only the Date Created and not the Date Modified
Post by: joeychan on June 13, 2025, 01:13:58 PM
Sorry for the omission of info. I use MacOS 10.14.16. I tested with a small batch of images and here is the output of the command line: exiftool "-filecreatedate<createdate" '/Volumes/Media/iPhone Photo Backups/Test/'

Warning: [minor] The ExtractEmbedded option may find more tags in the media data - /Volumes/Media/iPhone Photo Backups/Test/IMG_9437.mov
Warning: Error 256 running "/usr/bin/setfile" to set FileCreateDate - /Volumes/Media/iPhone Photo Backups/Test/IMG_9437.mov
Warning: No writable tags set from /Volumes/Media/iPhone Photo Backups/Test/IMG_9447.JPG
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - /Volumes/Media/iPhone Photo Backups/Test/IMG_9474.mov
    1 directories scanned
    0 image files updated
    1 image files unchanged
    9 files weren't updated due to errors

Thanks, Joey
Title: Re: Changing only the Date Created and not the Date Modified
Post by: StarGeek on June 13, 2025, 01:43:56 PM
Quote from: joeychan on June 13, 2025, 01:13:58 PMWarning: [minor] The ExtractEmbedded option may find more tags in the media data - /Volumes/Media/iPhone Photo Backups/Test/IMG_9437.mov
Warning: Error 256 running "/usr/bin/setfile" to set FileCreateDate - /Volumes/Media/iPhone Photo Backups/Test/IMG_9437.mov
Warning: No writable tags set from /Volumes/Media/iPhone Photo Backups/Test/IMG_9447.JPG
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - /Volumes/Media/iPhone Photo Backups/Test/IMG_9474.mov
    1 directories scanned
    0 image files updated
    1 image files unchanged
    9 files weren't updated due to errors

The Warning: [minor] The ExtractEmbedded option can be ignored. It is informative only, telling you that there may be more metadata, such as GPS tracks, in the file that isn't extracted but the current command.

The Warning: Error 256 running sound like you don't have the setfile command installed. From a previous post by Phil
Quote from: Phil Harvey on May 02, 2020, 07:03:03 AMexiftool "-filecreatedate<createdate" FILE

Note that you need the "setfile" utility on MacOS to set FileCreateDate.  You can install this with "xcode-select --install".

The Warning: No writable tags set from means that the JPEG doesn't have a CreateDate tag in it. Use this command to look at all the date/time tags in the file
exiftool -time:all -G1 -a -s '/Volumes/Media/iPhone Photo Backups/Test/IMG_9447.JPG'
Title: Re: Changing only the Date Created and not the Date Modified
Post by: joeychan on June 13, 2025, 02:18:41 PM
I fixed it by using: xcode-select --install! Thank you to both Phil and StarGeek, and to Phil for this amazing tool!