Setting file dates from EXIF data for JPEG files

I just came back from a fabulous 6 day trip to Utah, Arizona and Nevada with my family, retracing a tour there back in 1992 inspired by reading Edward Abbey’s “The Monkey Wrench Gang” which is set in the Four Corners area of the Southwestern USA. The Grand Canyon (North and South rim), Monument Valley, Zion National Park and Antelope Canyon were the main highlights of the journey.

We had three digital and one analog camera with us, as well as two laptops for backing up picture data. At home I found that some picture sets from my daughter’s camera had somehow lost their file time stamps, probably from something that went wrong when the JPEG files were copied to my son’s Lenovo S10E netbook (nice machine, BTW). This made sorting the pictures in chronological order difficult. A quick Google search found a solution. ExifTool (which is free software written by Phil Harvey) lets you set the last modified date of the file system to the date the picture was taken, which is stored in the EXIF data of the JPEG file by virtually any digital camera. Simply create a folder with all the JPEGs and run this command:

exiftool "-DateTimeOriginal>FileModifyDate" myjpgfolder

Voila! All the .jpg files in the folder will have the date again when they were taken. This also allows you to set the file date to the exact second. Typically memory cards for digital cameras are formatted as FAT which truncates creation times to even seconds, as it’s one bit short for storing the time more precisely than at 2 second intervals.

Leave a Reply

Your email address will not be published. Required fields are marked *