I’m currently out travelling and found that I had different time zone settings on my three cameras (phone, GoPro and digital). Easy to fix for next time but all the photos taken this far?

Fortunately, *nix comes with command line tools such as touch and in GNU you can even use a really neat -d flag to simply offset it directly, like explained in this stackoverflow post.

touch -r P151232.jpg -d '-2 hour' P151232.jpg

(see explainshell for parameters)

Unfortunately, the osx shell isn’t as kind as it doesn’t have the -d flag.

Instead I put together this little script that will do this for you, just supply the relative hours and file to update.

modify_time.sh -2 P123213.jpg

And then you can do this on multiple files of course, simply piping a find and using xargs:

find . -type f -name P* | xargs -I {} modify_time.sh -2 {}

And just to give some credits, both 4g and Wifi in Vietnam works great 🙂 until next time.