Skip to content

Instantly share code, notes, and snippets.

@fidelthomet
Created August 2, 2019 13:14
Show Gist options
  • Save fidelthomet/65237990651daf1fce7d26e49283c7c7 to your computer and use it in GitHub Desktop.
Save fidelthomet/65237990651daf1fce7d26e49283c7c7 to your computer and use it in GitHub Desktop.
batch offset timestamps in photos
#!/bin/bash
for f in DP2Q*.*; do
ts="$(GetFileInfo -d "$f")"
e="$(date -j -f "%m/%d/%Y %H:%M:%S" "$ts" +%s)"
((o=60*60*24*60-27120))
((e+=o))
nd="$(date -r $e "+%m/%d/%Y %H:%M:%S")"
SetFile -m "$nd" "$f"
SetFile -d "$nd" "$f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment