I am trying to extract and parse dates from .mts files, in order to rename files. The usual "-FileName<DateTimeOriginal" -d %Y%m%d%H%M%.%e works well with .jpg (and other file types too), but I found that it fails on my Sony .mts files. Using -DateTimeOriginal, I found that in these .mts files, dates are formatted this way: 2026:01:06 10:59:27+02:00 DST. I guess the +02:00 DST is what exiftool does not understand. Is there a way to help exiftool?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The %. in your -d (-dateFormat) option breaks that option. Additionally, you are using the %e as a date code (which only works under Mac/Linux and breaks under Windows), not as a file extension. To use it as a file extension, you need to double the percent signs.
Try -d %Y%m%d%H%M.%%e
For further details on using file name percent codes in the -d option, see Common Date Format Codes
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to extract and parse dates from .mts files, in order to rename files. The usual
"-FileName<DateTimeOriginal" -d %Y%m%d%H%M%.%eworks well with .jpg (and other file types too), but I found that it fails on my Sony .mts files. Using-DateTimeOriginal, I found that in these .mts files, dates are formatted this way:2026:01:06 10:59:27+02:00 DST. I guess the+02:00 DSTis what exiftool does not understand. Is there a way to help exiftool?The
%.in your-d(-dateFormat) option breaks that option. Additionally, you are using the%eas a date code (which only works under Mac/Linux and breaks under Windows), not as a file extension. To use it as a file extension, you need to double the percent signs.Try
-d %Y%m%d%H%M.%%eFor further details on using file name percent codes in the
-doption, see Common Date Format CodesThank you for your answer.
I tried:
and got:
which is exactly what I got previously with %e instead of %%e.
I tried:
and got:
When I try:
I get a correct date, but when I try:
I get:
BTW, I am using exiftool version 13.59
Last edit: Frederic Da Vitoria 17 hours ago