Author Topic: How to write to tag filemodifydate with another date but adding hours to it  (Read 1510 times)

grumpy

  • Newbie
  • *
  • Posts: 3

Hi
I am trying to modify the File's Metadata "FileModifyDate" to the value of "TrackCreateDate", but I want to add 8 hours to it. I am trying to accomplish this in one single command line, so I've tried the below snippet.
But although the "FileModifyDate" sets to "TrackCreateDate", it is not adding the extra 8hours I am expecting.


Am I missing something here?



@roscoe:~ ! exiftool ~/Desktop/185.MP4 -filemodifydate -trackcreatedate
File Modification Date/Time     : 2010:04:19 05:20:59+08:00
Track Create Date               : 2006:07:01 17:20:59


@roscoe:~ ! exiftool ~/Desktop/185.MP4 '-filemodifydate<${trackcreatedate}+8:00'
    1 image files updated


@roscoe:~ ! exiftool ~/Desktop/185.MP4 -filemodifydate -trackcreatedate
File Modification Date/Time     : 2006:07:01 17:20:59+08:00
Track Create Date               : 2006:07:01 17:20:59



Thanks


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
First, does -api QuickTimeUTC give you what you want?

The way to add an offset is via the advanced formatting feature:

exiftool ~/Desktop/185.MP4 '-filemodifydate<${trackcreatedate;ShiftTime($_,8)}'

(the above command requires ExifTool 9.69 or later)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

grumpy

  • Newbie
  • *
  • Posts: 3
Thanks! Phil after install 9.69, it works perfectly !