Set explicit date for bulk files with different dates.

Started by abalter, March 03, 2015, 12:06:22 PM

Previous topic - Next topic

abalter

Thanks for looking at it. Whew--I've never managed to learn regex's, so I would have never figured that out myself. Take a look at this output, and tell me if it makes sense. I'm noticing that the File Creation Date/Time still isn't changing. Do we need to add something?


C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool alldates="2013:04:06 06:07:08" -FileModifyDate="2013:04:05 06:07:08" -FileCreateDate="2013:04:05 06:07:08" IMG_4334.JPG
Error: File not found - alldates=2013:04:06 06:07:08
    1 image files updated
    1 files weren't updated due to errors

C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool -system:time:all IMG_4334.JPG
File Modification Date/Time     : 2013:04:05 06:07:08-07:00
File Access Date/Time           : 2013:04:05 06:07:08-07:00
File Creation Date/Time         : 2013:04:05 06:07:08-07:00

C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>ExifTool "-alldates<${alldates;s/^\d{4}:\d\d:\d\d/2015:03:06/}" "-FileModifyDate<${FileModifyDate;s/^\d{4}:\d\d:\d\d/2015:03:06/}" "-FileCreateDate<${FileCreateDate;s/^\d{4}:\d\d:\d\
d/2015:03:06/}" IMG_4334.JPG
    1 image files updated

C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool -system:time:all IMG_4334.JPG
File Modification Date/Time     : 2015:03:06 05:07:08-08:00
File Access Date/Time           : 2015:03:06 05:07:08-08:00
File Creation Date/Time         : 2013:04:05 06:07:08-07:00


Is there a way I can look at the Date Time Original and Create Date to confirm they are getting updated?

Thanks

StarGeek

I'm not sure why FileCreateDate isn't getting updated, it works here.  Maybe try just that part.  Make sure it's on one line,

You can look at the DateTimeOriginal and CreateDate by using ExifTool -DateTimeOriginal -CreateDate FILE or ExifTool -alldates FILE.  The last one will show you ModifyDate as well.

Finally, the error from your first command is because there wasn't a dash - in front of AllDates
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

abalter

Seems like it's close to working. I don't understand the difference in behavior between the three date time modification results that are each using the same regex.

test.cmd:

@echo off


set dt=2010:09:08 07:06:05
echo %dt%

exiftool "-alldates=%dt%" IMG_4334.JPG
exiftool "-FileModifyDate=%dt%" IMG_4334.JPG
exiftool "-FileCreateDate=%dt%" IMG_4334.JPG

exiftool -system:time:all IMG_4334.JPG
exiftool -alldates IMG_4334.JPG

exiftool       "-alldates<${FileModifyDate;s/^\d{4}:\d\d:\d\d/%dt%/}" IMG_4334.JPG
exiftool "-FileCreateDate<${FileCreateDate;s/^\d{4}:\d\d:\d\d/%dt%/}" IMG_4334.JPG
exiftool "-FileModifyDate<${FileModifyDate;s/^\d{4}:\d\d:\d\d/%dt%/}" IMG_4334.JPG

exiftool -system:time:all IMG_4334.JPG
exiftool -alldates IMG_4334.JPG

set dt=%1
echo %dt%

exiftool       "-alldates<${FileModifyDate;s/^\d{4}:\d\d:\d\d/%dt%/}" IMG_4334.JPG
exiftool "-FileCreateDate<${FileCreateDate;s/^\d{4}:\d\d:\d\d/%dt%/}" IMG_4334.JPG
exiftool "-FileModifyDate<${FileModifyDate;s/^\d{4}:\d\d:\d\d/%dt%/}" IMG_4334.JPG

exiftool -system:time:all IMG_4334.JPG
exiftool -alldates IMG_4334.JPG



gives:

C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>test 2014:03:06
2010:09:08 07:06:05
    1 image files updated
    1 image files updated
    1 image files updated
File Modification Date/Time     : 2010:09:08 07:06:05-07:00
File Access Date/Time           : 2010:09:08 07:06:05-07:00
File Creation Date/Time         : 2010:09:08 07:06:05-07:00
Date/Time Original              : 2010:09:08 07:06:05
Create Date                     : 2010:09:08 07:06:05
Modify Date                     : 2010:09:08 07:06:05
    1 image files updated
    1 image files updated
    1 image files updated
File Modification Date/Time     : 2010:09:08 08:06:05-07:00
File Access Date/Time           : 2010:09:08 08:06:05-07:00
File Creation Date/Time         : 2010:09:08 07:06:05-07:00
Date/Time Original              : 2010:09:08 07:06:05
Create Date                     : 2010:09:08 07:06:05
Modify Date                     : 2010:09:08 07:06:05
2014:03:06
    1 image files updated
    1 image files updated
    1 image files updated
File Modification Date/Time     : 2014:03:06 15:39:11-08:00
File Access Date/Time           : 2014:03:06 15:39:11-08:00
File Creation Date/Time         : 2014:03:06 06:06:05-08:00
Date/Time Original              : 2014:03:06 08:06:05
Create Date                     : 2014:03:06 08:06:05
Modify Date                     : 2014:03:06 08:06:05


file and image attached.

StarGeek

If you're questioning why the time changes, that's due to the nature of FileModifyDate.  This is part of the underlying OS (Windows, in your case).  Every time a file gets changed, the OS will update the FileModifyDate.  So when you set that value, but follow up with another command to change something else without using the -P option, it's going to change.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

abalter

I think I understand that. All the date/times are weird. For instance, in the final example (date entered as command line argument) The file modification date/time and file access date/time have the YEAR entered, but execution time.

File Modification Date/Time     : 2014:03:06 15:39:11-08:00
File Access Date/Time           : 2014:03:06 15:39:11-08:00


Also, in the 2nd example (using regex's with internally defined year/month/day), the File Modification Date/Time and File Access Date/Time are neither the original time (07:06:05) nor the time at execution.

Finally, in the 3rd example (year/month/day from command line argument), ALL the times except the first two (which are set by execution time) are wrong. They also should be 07:06:05.

I sure do appreciate the help. I hope this isn't too much work for you.