Filename with offset calculation

Started by Mike55, April 05, 2023, 02:01:29 AM

Previous topic - Next topic

Mike55

Hello,

I would like to change the name of a MTS Videos.
[H264]          DateTimeOriginal                : 2018:09:22 12:31:32+02:00 DST
If I run the following command:
exiftool -ext mts "-FileName<DateTimeOriginal" -d "%Y%m%d_%H%M%S.%%e" "00015.MTS"
the name changes to 20180922_123132.MTS

Is there any way that the offset (+2 hours) is included in the name change? I would like the name to look like this: 20180922_143132.MTS

Thanks a lot

Phil Harvey

You can do what you ask by adding -globaltimeshift 2 to the command.

However, in the way times are represented the offset has already been applied.

eg. 12:31:32+02:00 is the same time as 10:31:32 UTC (10:31:32+00:00).

If you add +02:00 to 12:31:32 you get a meaningless time.

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