How can I correct one camera’s EXIF timestamps so two photo sets sort together by capture time?
Asked 1/25/2018
3 views
2 answers
0
My wife and I photographed the same event with two cameras, and we want to combine the images into one sequence ordered by capture time. The problem is that the cameras were set to different times, but the offset between them is known and constant. There are several hundred photos from each camera, so we need an automatic solution rather than editing files one by one. I mainly use Linux, but Windows options are also fine. What’s the best way to shift the timestamps and then sort or rename the files correctly?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
8y ago
2 Answers
8
ExifTool is my go-to tool for time-shifting photos.
Assuming Windows, to add 1 hour to all date/time fields stored in the photo metadata:
exiftool.exe -AllDates+=1 C:\path\to\folder\of\photos
or to subtract one hour:
exiftool.exe -AllDates-=1 C:\path\to\folder\of\photos
By default, this will make a copy of the original as backup before modification. To do the modification in place, use the flag -overwrite_original_in_place:
exiftool.exe -AllDates-=1 -overwrite_original_in_place C:\path\to\folder\of\photos
You can use exiftool to move and rename files based on date/time. To organize photos into nested folders "Year/Month/Day/" with each photo named "image_HourMinuteSecond.[ext]" where the file will maintain its original extension (i.e., JPGs will stay JPGs, DNGs will stay DNGs):
exiftool.exe -d C:/path/to/put/organized/photos/%Y/%m/%d/image_%H%M%S.%%e "-filename<createdate" C:/path/to/folder/of/photos
Note that exiftool doesn't care which direction slashes you use for directories.
For more details about file moving/renaming see this documentation.
ExifTool has options for "dry-running" things, but I often end up zipping up a folder or copying it first before running my commands that rename/move files to make recovery easy just in case it doesn't do quite what I intended.
Additional usage:
Some of these examples are my own, while some come directly from the exiftool documentation reproduced here for convenience.
Fine-grained date/time adjustment. This is the long form to subtract 1 hour, for which the above is a shortcut:
exiftool.exe "-AllDates-=0:0:0 1:0:0" C:\path\to\folder\of\photos
So, To add 5 years, 10 months, 2 days, 10 hours, 48 minutes, and 4 seconds:
exiftool.exe "-AllDates+=5:10:2 10:48:4" C:\path\to\folder\of\photos
Filter by date/time before adjusting. I use this to fix a missed DST adjustment within a large group of pictures, it filters out anything before the time-shift:
exiftool.exe -if '$createdate gt "2012:03:11"' -AllDates+=1 -overwrite_original_in_place C:\path\to\folder\of\photos
You can run the tool recursively, meaning it will repeatedly go in to all subdirectories of the given path:
exiftool.exe -r C:\path\to\folder\of\photos -AllDates+=1
You can filter by file extension if you want to fix DNGs, but not JPGs, for example:
exiftool.exe -ext dng -AllDates+=1 C:\path\to\folder\of\photos
You can combine all these. Recursively find all JPGs created after Mar 11, 2012 and add 1 hour to the all dates by modifying the files in place:
exiftool.exe -r C:\path\to\folder\of\photos -ext jpg -if '$createdate gt "2012:03:11"' -alldates+=1 -overwrite_original_in_place
Originally by user13982. Source · Licensed CC BY-SA 4.0
user13982
8y ago
0
Generated from our catalog & community — verify before relying on it.
Yes—ExifTool is a standard way to batch-shift capture times in photo metadata. If one camera is consistently off by a known amount, adjust that set’s EXIF date/time fields, then sort or rename the files by capture time afterward.
Example commands:
- Add 1 hour:
exiftool -AllDates+=1 /path/to/photos - Subtract 1 hour:
exiftool -AllDates-=1 /path/to/photos
On Windows, the same works with exiftool.exe.
By default, ExifTool keeps a backup of the original file. If you want to update files in place, use:
-overwrite_original_in_place
So a typical workflow is:
- Put the photos from the camera with the wrong clock in a folder.
- Use ExifTool to shift its timestamps by the known offset.
- Merge both sets and sort/rename by capture time in your file manager or catalog software.
Because the offset is constant, this is exactly the kind of batch correction ExifTool handles well.
Recommended products
UniqueBot
AI8y ago
Your Answer
Related Questions
How can I organize RAW photo files into date-based folders on Linux?
Can EXIF DateTimeOriginal be treated as UTC if OffsetTimeOriginal is missing?
How can I batch-correct wrong photo capture dates on Windows before uploading to Google Photos?
How can I batch-correct wrong photo timestamps without changing other EXIF data?
How can I batch-edit photo metadata, especially missing capture dates, on Linux or Windows?