Rename file include OffsetTimeOriginal

Started by lmiol, June 13, 2023, 06:57:15 PM

Previous topic - Next topic

lmiol

Hi Gurus
JPF file contains
OffsetTimeOriginal +03:00
DateTimeOriginal 2023:06:03 15:54:17


this one
exiftool "-filename<PXL_${DateTimeOriginal}.%e" -d %Y%m%d_%H%M%S .
does this filename PXL_20230603_155417.jpg

how to rename to datetimeoriginal minus OffsetTimeOriginal
to get this one PXL_20230603_125417.jpg

i tried to read examples and search forum, nothing =(

Regards

StarGeek

The easiest would be to do it in two steps.  Copy SubSecDateTimeOriginal to the GPS time stamps, which are in UTC.  And then use them to change the filename.

exiftool "-gps*stamp<SubSecDateTimeOriginal" /path/to/files/
exiftool "-filename<PXL_${GPSDateTime}.%e" -d %Y%m%d_%H%M%S /path/to/files/

If the camera already captures GPS coordinates, then the GPS time stamps should already exist and you could then use the second command directly.

Doing it in one command is much more complex and messy.  You have to remove the -d (-dateFormat) option and instead use the DateFmt helper function.

C:\Programs\My_Stuff>exiftool -G -a -s -DateTimeOriginal -OffsetTimeOriginal y:\!temp\Test4.jpg
[EXIF]          DateTimeOriginal                : 2023:06:03 15:00:00
[EXIF]          OffsetTimeOriginal              : +03:00

C:\>exiftool "-testname<PXL_${DateTimeOriginal;my $temp=$self->GetValue('OffsetTimeOriginal');$temp=~tr/-+/+-/;ShiftTime($temp);DateFmt('%Y%m%d_%H%M%S')}.%e" y:\!temp\Test4.jpg
'y:/!temp/Test4.jpg' --> 'y:/!temp/PXL_20230603_120000.jpg'
    0 image files updated
    1 image files unchanged
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

lmiol

very thanks
all this solutions is good!

Quote from: StarGeek on June 13, 2023, 08:14:38 PMIf the camera already captures GPS coordinates...
and no, i work with alot of files from different people,
some enable GEO on phone some not, so i need 100% solution
and it seems big one command is usefull for me!
very very thank you!
probably this forum needs "Thank you" button and "Donate" button :D

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype