Sample Header Ad - 728x90

Add exif creation time with correct timezone (TZD) to filename

2 votes
1 answer
656 views
Hi i have a problem renaming a lot of photo and images files. I use a shellscript in automator to rename them by EXIF date and time. But the time is given by UTC and im living in europe with +0100 in vinter and +0200 in the summer.

Example: a picture from 2020-06-30 taken at 22:22:30
is named "**2020-06-30 20/22/30 IMG_0001.jpg**"
instead of. "**2020-06-30 22/22/30 IMG_0001.jpg**" im using the script: #/bin/zsh for f in "$@" do filedate=$(mdls $f | grep kMDItemContentCreationDate -m 1 | awk '{print $3, $4}'); filename=$f:t filepath=$f:h mv $filepath/{"$filename","$filedate $filename"} done Can i somehow just add +0200 or +0100 to the "filedate...$4" and how?(and then manually order when the number of houser in the name is over 24) or is there a smarter way to ad time zone designator(TZD) to the script? I have not used script before so im completely new to all this. Hopw someone can help me.
Asked by Claus Dragonmonkey Olsen (21 rep)
Jul 9, 2020, 11:31 PM
Last activity: Apr 7, 2021, 01:06 PM