Update image timestamp
William McKeehan
William McKeehan
September 10, 2022

Update image timestamp

Update image timestamp

This script will update the file timestamp on an image to match its creation date.

find . -type f | while read PIC
do
  DATE=$(/usr/local/bin/exiftool -p '$DateTimeOriginal' "$PIC" | sed 's/[: ]//g')
  touch -t $(echo $DATE | sed 's/\(..$\)/\.\1/') "$PIC"
done