Skip to content

Instantly share code, notes, and snippets.

@danikaze
Last active October 27, 2019 05:10
Show Gist options
  • Save danikaze/94025a99a2cc9adeb68716d7d1f0f30b to your computer and use it in GitHub Desktop.
Save danikaze/94025a99a2cc9adeb68716d7d1f0f30b to your computer and use it in GitHub Desktop.
How to fix dates in photo files

Fixing times

Need exiftool

Imagine you live in Tokyo and go to Hong Kong, but forget to change the time in the camera (HK is -1h relative to Tokyo). All your photos would say they were taken one hour before they actually were.

To add one hour to the time fields (DateTimeOriginal, CreateDate and ModifyDate) of all the photos in a folder, just run:

./exiftool -v -AllDates+=1 FOLDER

Adding correct GPS coordinates to photos

  • GPS coordinates (.GPX files) are usually stored in UTC.
  • EXIF data don't have usually a timezone.

This means that when adding GPS coordinates to a photo via Lightroom, the local time of the computer will be used.

To do it properly, the easiest way is to:

  1. set the computer to the local time of the place where the photos were taken
  2. add the GPS data
  3. fix the computer time back

Other option is to temporary change the photo date times with the method explained in the top, but this takes much more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment