Time shifting... but hours and minutes in opposite directions

Started by philbond87, April 27, 2022, 09:25:53 AM

Previous topic - Next topic

philbond87

It seems that -AllDates takes an hr:min:sec string but shifts the time all in one direction based on that string,

exiftool -overwrite_original -AllDates+=03:15:05

Is that correct?

I've tried adding signs to the time string (eg. "03:-15:05") in order to add three hours and subtract 15 minutes but that didn't seem to work, as it appears only to consider the += or -= and apply it to all of the values.

I also tried doing each (hr, min, sec) as separate -AllDates+= or -AllDates -= commands... all in the same line... but then it only appears to shift the last command in the line.

exiftool -AllDates+=03 -AllDates-=15 -AllDates+=5

Would I have to do it in three separate passes?

Thanks,
Phil

StarGeek

You have to do the math first if you don't want to do them separately.  So you would use
-AllDates+=2:45:05
or convert the hours to minutes first
-AllDates+=0:165:05

For more details, see ExifTool Date/Time Shift Module.

Quote from: philbond87 on April 27, 2022, 09:25:53 AM
I also tried doing each (hr, min, sec) as separate -AllDates+= or -AllDates -= commands... all in the same line... but then it only appears to shift the last command in the line.

exiftool -AllDates+=03 -AllDates-=15 -AllDates+=5

See Note #1 under the -TAG[+-^]=[VALUE] option.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).