Set exif DateTimeOriginal based on file names

Started by hscheele, June 17, 2022, 10:46:26 AM

Previous topic - Next topic


Hi all,

Just searching an easy way to sync Exif value 'DateTimeOriginal' depending on file name:

Filename - 2012-11-04__11.58.50.286.jpg
DateTimeOriginal - 4501:01:01 00:00:00

Is there a easy way to do so without doing this manually file by file? Already checked that I can take file name withing "Time Wiz" but in this case the file name needs to be splitted / converted to be used.

Thanks a lot!

// Hartmut


Yes, this is easy to do with a Metadata Template. Create a template with your desired tag(s) as target and use something like
{File.Name|substr:0,4}:{File.Name|substr:5,2}:{File.Name|substr:8,2} {File.Name|substr:12,2}:{File.Name|substr:15,2}:{File.Name|substr:18,2}
for the "Fill the tag from this data" part. Then you can simply select any number of files, execute the Metadata Template on them, and you are done.

You should check the expression above first in the Vartoy App to be sure that all indices etc. are correct.
Win 10 / 64, IMatch 2018, IMA


@hscheele: Since your post  count is low, I provide some additional pointers to tools and features that may help you with this:

Metadata Templates are a powerful tool to automatically add, modify and remove metadata, categories and collections, by user action or automatically when files are added to IMatch or are updated externally.

The same variable should also be usable in the Time Wiz (specialized on working with time) and the Metadata Mechanic, an all-purpose tool for dealing with metadata issues or all sorts and batch updates.

As noted by thrinn, the VarToy App allows you to create and test variables.
If you copy & paste the variable thrinn has provided above, you can see which date & time it produces for your files. If you are satisfied, you can use the variable in a metadata template (if you need it often) or just once in the TimeWiz, if you only need to correct some files.

Tip: Usually users do it the other way.
They rename files based on the EXIF/XMP timestamp to include the date and time in the file name. You can do that easily in IMatch with the Renamer.
-- Mario
IMatch Developer
Forum Administrator  -  Contact & Support - Follow me on 𝕏 - Like on Facebook


Mein Weg ist ähnlich, mit trim:alpha entferne ich aber zuerst alles, was keine Ziffer ist, erst danach wird die Position der Ziffern zur Bildung der Datums- und Zeitwerte von links nach rechts verwendet

My way is similar, but with trim:alpha I first remove everything that is not a digit, only then is the position of the digits used to form the date and time values from left to right

{File.Name|trim:alpha;substr:0,4}:{File.Name|trim:alpha;substr:4,2}:{File.Name|trim:alpha;substr:6,2} {File.Name|trim:alpha;substr:8,2}:{File.Name|trim:alpha;substr:10,2}:{File.Name|trim:alpha;substr:12,2}



Hi all,

Thanks a lot for all your quick replys. It works after I followed (and adopted) your examples.