Change time (date) in or from exif-data

dateexif

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

Is there a solution to change time for all files in a directory about +/- 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.

Best Answer

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.

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
Related Question