Eric Wilson's Blog

Experiments in engineering, life and the pursuit of a better hammer.

Eric Wilson's blog discussing Product Development and Software Engineering.

  • Blog
  • Snippets
  • About
  • Contact
  • Search

How To Change The Created And Modified Date Of Copied Or Downloaded Image Files

August 18, 2023 by Eric Wilson in software

Invariably when returning home from vacation I have a bunch of images and videos (iPhone and GoPro) that I want to add to my online library. I’m a stickler for correct meta data so seeing the dates / timestamps get clobbered to the current date / timestamp when copying or transferring was a point of frustration. Many of the tools I use to organize and edit these files use the Created date to sort or to build timelines so correcting each file manually was time consuming and laborious.

Enter the wonderful ExifTool by Phil Harvey. ExifTool gave me a simple and fast process to correct all of clobbered dates and timestamps straight from the CLI.

Since I’m using Mac I install the ExifTool via Homebrew:

➜  ~ brew install exiftool

Then, I create a unique directory to contain all the image & video files I want to update and subsequently copy / unzip / download them there. CD into that directory and run the following command:

➜  iCloud Photos exiftool '-FileCreateDate<CreateDate' '-FileModifyDate<ModifyDate' . -api QuickTimeUTC
    1 directories scanned
   10 image files updated
    1 image files unchanged

If you want to run the command on a directory you are not currently inside of just add the path to the files you want to update vs the current directory dot ‘.’ I show in the example.

August 18, 2023 /Eric Wilson
exif, video, photo, meta data, created date, modified date, gopro, iphone
software
This work is licensed under a Creative Commons License and is the private blog of Eric Wilson.
The opinions are my own and are not endorsed by my current or former employers or colleagues.
Creative Commons License