You probably know this one. You copy images to a new machine or move them to another drive, and the sort order is suddenly off. The file date is the date of the copy, not the date the photo was taken.

Some tools use the EXIF capture date, some the file date. OneDrive sorts by file date, which is annoying in this scenario.

Fix with ExifTool

exiftool reads both and can set the file date from the EXIF date. It’s available for Windows and Mac at exiftool.org.

Open Terminal or CMD and change into the folder with your images.

Heads up: back up the images first.

Then run:

exiftool -v -r "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" *

The command reads DateTimeOriginal from the EXIF data and writes that value into FileCreateDate and FileModifyDate on the filesystem. -r makes it recurse into subfolders.