Correcting EXIF timestamps in bulk with ExifTool

Camera clocks get out of sync remarkably quickly. For my FotoPeli workflow timestamps are really important so before every shoot I synchronise the time on my cameras to my watch. Today I used a three cameras. Guess who forgot to sync the C Cam? Duh. So… If you need to correct the capture times of a batch of Nikon NEF files, ExifTool makes it remarkably easy.

(Assuming you’re comfortable with the command line and, FFS, have Brew installed)

Subtracting time from a folder of RAW files

So, not just a few seconds out today – C Cam was still in Summer Time. So I had to fix an hour and 29 seconds for all images off that card.

Simples if you open Terminal, navigate to the folder containing your NEF files (cd), then run:

exiftool "-AllDates-=0:0:0 1:0:29" -overwrite_original *.NEF

This subtracts 1 hour, 29 seconds from three standard EXIF date fields:

  • DateTimeOriginal – original capture time.
  • CreateDate – image creation time.
  • ModifyDate – metadata modification time.

Understanding the syntax

-AllDates identifies the three EXIF fields.

-= means subtract.

0:0:0 1:0:29 represents the adjustment in the format:

Years:Months:Days Hours:Minutes:Seconds

The quotation marks keep the entire expression together as one Terminal argument.

Checking the results

To verify the corrected timestamps:

exiftool -DateTimeOriginal -CreateDate -ModifyDate *.NEF

ExifTool modifies the metadata, not the actual RAW image data.

The -overwrite_original option prevents ExifTool from retaining backup copies of the original files (so make your own backup first).

Bonus: The same syntax works in reverse using += to add time, or with different values to correct other clock discrepancies.

A tiny command-line tool, but an incredibly useful addition to a photography workflow.

Clarify the exact timestamp adjustmentAdd a safer dry-run example

Now all OK in Lightroom.


Comments

Leave a Reply

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