Exiftool would be the best for dealing with these varying formats. You would need to make sure that they're not all in the same directory to avoid mistakes.
The easiest is the "yyyymmdd_HHMMSS" and "yyyy-mm-dd HH.MM.SS" patterns or any variations where the numbers go from year to seconds. As per exiftool FAQ #5, the command would be simply be:
exiftool "-AllDates<Filename" /path/to/files/
In these cases, exiftool will extract the numbers and apply them to the appropriate places in order.
The "dd-mm-yy_HHMM" is a bit more complex, especially if it doesn't contain the seconds. Also, since the year is incomplete, you would have to separate any pictures that may be 19##s from the 20##s. have Your command would be something like:
exiftool "-AllDates<${Filename;s/(\d\d)-(\d\d)-(\d\d)/20$3$2$1/} 00" /path/to/files/
For files that have a 19## year, you would change 20$3$2$1
into 19$3$2$1
. This command also defaults to a seconds value of 00.
These commands creates backup files. Add -overwrite_original
to suppress the creation of backup files. Add -r
to recurse into subdirectories. If this command is run under Unix/Mac/PowerShell, reverse any double/single quotes to avoid bash interpretation.