Cheat sheet: modifying dates with exiftool

01/09/2026

To view info for a file:

exiftool -s -G myphoto.jpg

To set the date based on the filename:

exiftool -overwrite_original "-alldates<filename" myphoto.jpg

To set the date based on the XMP metadata date:

exiftool  -overwrite_original "-alldates<MetadataDate" myphoto.jpg

To set the date to a manually specified date if the photo doesn’t already have a date:

exiftool -overwrite_original -if 'not $DateTimeOriginal' -alldates="2017:04:16 00:00:00" myphoto.jpg

To make a relative adjustment to the date:

exiftool -overwrite_original "-AllDates+=00:00:00 03:01:00" *.JPG

Note that photos from mobile phones will use local date times with time zones. For example:

[EXIF] ModifyDate: 2022:06:10 18:10:49
[EXIF] DateTimeOriginal: 2022:06:10 18:10:49
[EXIF] CreateDate: 2022:06:10 18:10:49
[EXIF] GPSTimeStamp: 23:10:24
[EXIF] GPSDateStamp: 2022:06:10
[EXIF] OffsetTime: -05:00
[EXIF] OffsetTimeOriginal: -05:00
[EXIF] OffsetTimeDigitized: -05:00

You can set UTC time from local time with the following series of commands:

exiftool -overwrite_original "-GPSDateTime<DateTimeOriginal" *.JPG
exiftool -overwrite_original "-GPSDateTime+=6" *.JPG
exiftool -overwrite_original "-GPSTimeStamp<GPSDateTime" "-GPSDateStamp<GPSDateTime" *.JPG