If this site goes down it is because of the crappy DreamHost web hosting: They will disable your "unlimited traffic" web server if a single bot hammers the site with a moderate load.  If necessary, an alternate ExifTool forum page is available at

Main Menu

Batch rename .m4a files with CreateDate + 2 hours

Started by pdeli, August 03, 2022, 12:09:28 PM

Previous topic - Next topic


Dear ExifTool team,

I am trying to batch rename .m4a files with the creation date. Thanks to two forum threads here at and one in, I managed to get to this point:
exiftool '-FileName<CreateDate' -d '%Y%m%d %H%M%S.%%e' .
However, because the files have been created at GMT+02:00, I'd like to add 2 hours to the CreateDate.

Can someone please let me know what code I have to use for that?

Thanks in advance and best regards,

System used:
  • exiftool version 12.42
  • macOS Monterey 12.5 (Intel)




I only have Windows.
On PowerShell it is like this:
exiftool -CreateDate+=2 -ext m4a .
exiftool -FileName<CreateDate -d '%Y%m%d %H%M%S.%%e' -ext m4a .
On CMD it like this:
exiftool -CreateDate+=2 -ext m4a .
exiftool "-FileName<CreateDate" -d "%Y%m%d %H%M%S.%%e" -ext m4a .

See also:


One thing to remember is that in videos, CreateDate is supposed to be in UTC.  It you change the embedded CreateDate by adding two hours to it, then Windows Properties->Details->Media created time will be off.

If you want to add the two hours to the tag, then @Jom has the right command.  But I recommend against it if the time is properly set to UTC.

When it comes to renaming, if the CreateDate is properly set to UTC and you are in the same +02:00 time zone, then all you need to do is add the -api QuickTimeUTC option to your command
exiftool '-FileName<CreateDate' -api QuickTimeUTC -d '%Y%m%d %H%M%S.%%e' .

Otherwise, you can use the GlobalTimeShift option
exiftool '-FileName<CreateDate' -GlobalTimeShift 2 -d '%Y%m%d %H%M%S.%%e' .

Edit: Don't know why I assumed Windows but Macs also correctly understand that a video is supposed to be UTC and will adjust the displayed time as well.
Troubleshooting hints:
* Did you read FAQ #3 and use the command listed there?
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.


Absolutely right, the date and time must be kept in accordance with the standard. It also seemed strange to me to want to increase the time instead of specifying UTC, but I thought that the person knows what he is doing.

Format is this:
Lock here, for example:


Thanks for all the answers.

I now realise that the wording of the initial post was poorly phrased. Sorry.

What I would like is to use the data found in CreateDate and add/subtract local time and push the result into a filename. Therefore, I don't want to tamper with CreateDate, I just want to use the data in CreateDate to generate a filename.

In other words
  • Extract Creation Date
  • Add/Subtract Local Time
  • Rename the original files (i.e., 'YYYYMMDD hhmmss.extension', where YYYYMMDD hhmmss = CreateDate +/- local time)

The piece of code of the initial post does the job, except that I live in Z+02:00 and as a nice to have, I wanted the date to reflect that. As a nice to have, it would be cool that Z reflects variable local time, not hard coded, but only as a nice to have.

Phil Harvey

StarGeek gave a command that does this using the -globalTimeShift option.

- 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 ($).


That's the one:
exiftool '-FileName<CreateDate' -GlobalTimeShift 2 -d '%Y%m%d %H%M%S.%%e' .
It worked exactly as I wanted!

Thank you very much for your support  :)