If you have Android phone and you’ve ever copied photos from the phone to your mac - you probably know the pain. Created date and time of photos is totally wrong! I was doing weird things to fix that and I’ve finally found simple way. Here it is (spoiler alert: ExifTool).

Why you need good “Date Created” info?

Because sometimes you really want to sort by date, or (like me) you want to mix photos from many sources and go through them chronologically like they are from one source. If you are taking photos with phone and camera at the same trip - that is probably your use case.

Also you might want to search for photos taken at some time interval - without properly tagged date, good luck with that.

What can go wrong?

There are mostly three cases, where this metadata on MacOS side is incorrect:

  1. Coping photos from your Android phone - “Date Created” becomes the time you copied photo. In theory it makes sense but in practice, it hurts.
  2. Taking photos with camera but forgetting to change timezone on camera. This one is of course user error, there is nothing wrong with Mac here. But still I think fixing this (moving timezones) should be much easier.
  3. Videos from phone - I don’t know why but videos from my phone sometimes have incorrect time set in EXIF data, even though name of the file (which contains time as well) is correct.

Ad 2. Moving timezones is indeed easy when you use Apple’s Photos app. It’s simple, quick and intuitive. The issue is - I couldn’t see this change with filesystem (Finder). And I don’t want to be limited to Photos (or even Mac) for going through my pictures.

Easy way - paid apps

I went trough many apps. There are some (potentially) pretty good paid options, like “A Better Finder Attributes” (my personal favorite), “SetEXIFData”, “Photo Exifier”, “Exif Sync”.

They might be really good and do a lot of stuff but I want two very simple things:

  1. I want to take date and time from EXIF info and put it into file info, that would make MacOS understand it.
  2. I want to change timezone in photo, i.e. move time a few hours forward or backward.

That’s why I decided to solve this issue on my own - saving money and learning something at the same time!

Also easy and free way - command line

That was amazing discovery. Thing that took me a lot of time with different methods could be done with one simple command. I present to you THE ALMIGHTY, EXCELLENT, SUPREME… EXIFTOOL

ExifTool is awesome, it is command line tool to “Read, Write and Edit Meta Information!”. It was written in Perl, which makes it even more impressive.

A lot of things can be done with ExifTool so let’s focus on stuff I care about the most and go through it step by step:

IMAGE - for brevity - means path to image file, can be also with wildcards, so all images in directory would be written as “*”

  • Reading all metadata (probably more than you expect) exiftool --read-Tags IMAGE
  • Reading metadata that prints it in format ready for use in next commands of ExifTool: exiftool --read-Tags -args IMAGE
  • Reading one piece of metadata: exiftool -MATADATA_NAME IMAGE, in our case that might be exiftool -DateTimeOriginal IMAGE

Moving time with ExifTool

And now the most important:

  • modifying numerical data can be done with “+=X” - assign value to itself but incremented by X. It is equivalent to doing variable =+ X. Analogically, you can do “-=X” which means variable =- X. For example, Date is numerical data. Thus doing exiftool "-DateTimeOriginal+=1" IMAGE will change “DateTimeOriginal”’’ to “DateTimeOriginal + 1” and “+ 1” is interpreted as increased by one hour. so exiftool "-DateTimeOriginal-=1" IMAGE changes EXIF time to one hour ahead. If IMAGE had time set to 10:54 it will be changed to 11:54.

That solves the problem with timezones - to move all images in directory two timezones ahead/back you can just do exiftool "-DateTimeOriginal-=1" *. It’s that simple. For my that was groundbreaking discovery.

Fixing “Date Created”

But that doesn’t change file’s “Date Created”. It’s not based on EXIF “DateTimeOriginal”, but on another metadata: “FileModifyDate”. So now we want to move data from “DateTimeOriginal” to “FileModifyDate”.

With ExifTool that’s surprisingly simple - the schema is exiftool "-METADATA_NAME1<METADATA_NAME2" IMAGE, so in this case: exiftool "-FileModifyDate<DateTimeOriginal" IMAGE, where “IMAGE” can be all files in directory: exiftool "-FileModifyDate<DateTimeOriginal" *.

Two commands to rule them call (or TL;DR)

So in short, to move time by X hours ahead you can do: exiftool "-DateTimeOriginal-=1" *

To set “Date Created” to time from EXIF’s “DateTimeOriginal”: exiftool "-FileModifyDate<DateTimeOriginal" *

Two simple and powerful lines. ExifTool FTW!

Alternative way

It’s fair to say there are some free alternatives as well but they were hard to run/use for me, you might get better luck. You can see applications based on ExifTool here: ExifTool website. For example FastPhotoTagger seems to be still developed. But taking into account that only two simple commands are enough, I wouldn’t bother. Unless you are afraid of command line, but then what you are doing on my blog?!