I Dare You!

by peter_budo

submit your photo

Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

Does anyone know of such a thing?

I want to specify a directory and have the software find all the photos in the directory and its sub-directories, and if they contain EXIF date/time, it sets their filesystem timestamp to match the EXIF.

share|improve this question

5 Answers 5

This is the inverse of Is there any software which will set the EXIF Dates based on the file's modification date?, and I'm sure all of the programs listed there will apply. Of these, for this very simple task, jhead is my suggestion. For example, the command

jhead -ft *.jpg

sets a bunch of files so that the file timestamp matches exif — but it doesn't do recursion into subdirectories. (You could use a small batch script to do that.)

Other utilities like exiftool or exiv2 are much more capable, but at the price of complexity. I can never remember offhand the right options to do anything with those and have to look at the documentation every time, but jhead -ft is easy to remember with the mnemonic "fix time".

share|improve this answer
You are right, this is the opposite but infinitely more useful :) –  Itai Sep 14 '12 at 17:11
jhead is very useful for this - AND for many other jpg file manipulations. Be careful when using it - it is an extremely powerful tool that can wreak a certain amount of havoc if misused. I recommend using it in a batch file so you always do what you intend, and testing the result on a test file set first. –  Russell McMahon Sep 14 '12 at 23:23
+1 but I awarded myself the answer ;-) Just so others in future can find a way to do exactly what I asked ... –  Mawg Sep 19 '12 at 4:39

Irfanview and jhead will both do what you want.
Both free.
Links to both below.
jhead is command line driven or can be called by other processes.
Irfanview version can be invoked from a command line or internally in a batch or on a file by file basis.

Example below for Irfanview shows how to copy in either direction:

Irfanview allows command line or batch or per file date/time transfer from EXIF to file spec or vice versa (with no other file changes if so desired).

Source: Free from www.irfanview.com

Batch "save with original date/time".
This will set file date and time to camera EXIF values.

  • File / batch / Add all.
    Advanced / Save files with original date/time

From command line - this is a "rotate" with NO action except to copy date/time from EXIF to file date and time. The opposite can also be achieved if desired. :

  • i_view32.exe file_spec\*.jpg /jpg_rotate=(0,0,0,1,0,0,0,0)

To copy date/time in opposite direction ((filespec to EXIF) use as above with (0,0,1,0,0,0,0,0)

jhead will do just about anything you can imagine with jpeg files

Source: Free from http://www.sentex.net/~mwandel/jhead/

I use a batch file as below. Other options are possible:

  • jhead -ft %1.jpg

They say: Things jhead can modify in an exif jpeg file

  • Up-right images according to rotation tag using jpegtran
    Set or relative adjust internal exif timestamps
    Fix date / time offsets in large batches of images
    Re-name or date stamp files according to exif timestamp
    Transfer exif headers between images
    Replace thumbnails inside Exif headers
    Edit jpeg comments (but not the Exif comments)
    Delete exif or comment sections from jpeg images
    Create new minimal exif header containing date and thumbnail
share|improve this answer
up vote 0 down vote accepted

I suggested it to the author of PhotoRenamer, who replied ...

PhotoRenamer 3.2 www.tgmdev.be/bin/PhotoRenamer_Setup_19Sep2012.exe

I add a button in the ‘Options’ tab of the Ribbon .. From there, you can select the option for updating the file time status of the file ..

By the way, to avoid the use of mask, I also add a new mask attribute: %F. If you use this simple mask, the file is renamed ... with it’s own name ... So you are not obliged to rename the file for which you want to update the file time attributes ...

share|improve this answer

Just another command line EXIF tool that can do change the last modified date of files to match the time of taking the picture, based on the EXIF metada in the JPEG image file:

 exiv2 -T rename somedir/foo*.jpg

No worries, the command argument rename is ok there and does no harm.
It's just that the file rename action is misused to only create the side effect of changing the timestamp.

share|improve this answer

While I really don't recommend relying on the file date/time when it comes to your images you can use a free tool called EXIF Date Changer to batch set the file dates of all your JPG images. The default setting will set both the date created and date modified file dates to the photo taken taken.

The reason why I don't recommend this is the file date is easily updated. If you edit the image the date modified gets updated. If you copy the image it gets a new date.

A much better solution is to rename the files to include the date/time in the filename itself. This still allows easy sorting and works well with images stored on iPhones / dropbox.

EXIF Date Changer - Set file dates to date taken

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.