Skip to content

Instantly share code, notes, and snippets.

@adoyle
Created March 25, 2025 13:26
Show Gist options
  • Select an option

  • Save adoyle/794f14cbc001d59ed931d4b08d74a355 to your computer and use it in GitHub Desktop.

Select an option

Save adoyle/794f14cbc001d59ed931d4b08d74a355 to your computer and use it in GitHub Desktop.
Quick hack to fix file timestamps on image files that are exported by Apple Photos.
#/usr/local/bin/bash
# Sets file modification time to the same as the creation time
find . -type f | \
while read i; \
do IFS=' ' read -r -a result <<< $(ls -lUTD %Y%m%d%H%M.%S "$i");\
touch -t ${result[5]} "$i";\
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment