23

In the question Change file created date from JPEG EXIF metadata there are great scripts to update the file system date and to match date stored in the file. But what if the “Date and Time (original)” value is bad in the Exif data (because of an incorrectly set time in the camera)?

Is there a solution to change the time for all files in a directory to +/- n minutes? Either correct the Exif data (and then use one of the great scripts from the link above) or only correct the timestamp of the files.

Werner
  • 231
  • I end up quite often in this situation when I collect photos after vacation from different cameras from different people, so I need to "shift" a bit for each source of photos. – Grzegorz Wierzowiecki Jul 19 '15 at 12:39

4 Answers4

25

The tool you need is called jhead. Some OSs release it via their package managers, but this is the home of jhead, and you can download the latest version from there. Note that jhead will only work on JPEG files. Other files with exif information are not supported.

From the jhead manual:

-ta Adjust time stored in the Exif header by h:mm forwards or backwards. Useful when having taken pictures with the wrong time set on the camera, such as after travelling across time zones, or when daylight savings time has changed. This option uses the time from the "DateTimeOriginal" (tag 0x9003) field, but sets all the time fields in the Exif header to the new value.

Examples:

Adjust time one hour forward (you would use this after you forgot to set daylight savings time on the digicam)

jhead -ta+1:00 *.jpg

Adjust time back by 23 seconds (you would use this to get the timestamps from two digicams in sync after you found that they didn't quite align)

jhead -ta-0:00:23 *.jpg

Adjust time forward by 2 days and 1 hour (49 hours)

jhead -ta+49 *.jpg
crantok
  • 123
  • 4
Will
  • 2,754
  • I tried this and had great success until I tried it on movie files and realised that the program will only work on JPEGs, not all files that have EXIF info. I used exiftool for the movie files. jhead was faster but I won't use these tools enough to care about that and uninstalled jhead. I recommend making the limitation to JPEG explicit in the answer. (The only mention of JPEG by the OP is in the link to another stack exchange answer.) (Also, I tried to edit the answer myself but the approval process is slow.) – crantok Oct 13 '23 at 11:57
10

From a comment at petapixel.com and also another answer, here are some examples how to achieve this with exiftool:

exiftool "-DateTimeOriginal+=0:1:2 3:4:5"
exiftool -DateTimeOriginal+='5:10:2 10:48:0'
exiftool -DateTimeOriginal-='0:0:0 1:3:0'
1

Shotwell

Also possible with Shotwell (0.28+)

Settings:

screenshot settings

Select all the photos and:

screenshot

Test with

identify -verbose *.jpg | grep 1992 # or "DateTime:\|exif:Make:\|exif:Model\|Filesize\|Flash:\|pixels:"
Pablo A
  • 2,712
-1

DigiKam can do it too:

Batch > Time adjust

You can add/subtract time to a goup of photos and more options