set all dates from earliest date in any tag

Started by golek, July 09, 2023, 11:39:28 AM

Previous topic - Next topic

golek

I have some png that get from this command:
exiftool -time:all -G1 -a -s

Result:
[System]        FileModifyDate                  : 2023:07:09 08:19:13-07:00
[System]        FileAccessDate                  : 2023:07:09 08:19:15-07:00
[System]        FileInodeChangeDate            : 2023:07:09 08:19:13-07:00
[XMP-photoshop] DateCreated                    : 2017:03:31 22:47:25
[XMP-xmp]      MetadataDate                    : 2017:04:12 13:56:18+03:00
[XMP-xmpMM]    HistoryWhen                    : 2017:04:12 13:56:18+03:00
[PNG]          CreationTime                    : 2023:07:06 17:39:17-07:00

I want to set all dates to the earliest available date (here the xmp-photoshop DateCreated).
And set also file creation and modification date to that.
I don't want to change filename.

greybeard

This might be helpful

https://exiftool.org/forum/index.php?topic=7986.0

golek

#2
I'll investigate the set all to oldest known date code.

As a simple command:
exiftool '-AllDates<$DateCreated'
was good for using the one I know is earliest, in this case
[XMP-photoshop] DateCreated

The time tags changes are not complete. I'll have to change the system File date and PNG CreationTime

[System]        FileModifyDate                  : 2023:07:09 08:19:13-07:00
[System]        FileAccessDate                  : 2023:07:09 08:19:15-07:00
[System]        FileInodeChangeDate            : 2023:07:09 08:19:13-07:00
[XMP-photoshop] DateCreated                    : 2017:03:31 22:47:25
[XMP-xmp]      MetadataDate                    : 2017:04:12 13:56:18+03:00
[XMP-xmpMM]    HistoryWhen                    : 2017:04:12 13:56:18+03:00
[PNG]          CreationTime                    : 2023:07:06 17:39:17-07:00

to

[System]        FileModifyDate                  : 2023:07:09 09:11:54-07:00
[System]        FileAccessDate                  : 2023:07:09 09:19:05-07:00
[System]        FileInodeChangeDate            : 2023:07:09 09:11:54-07:00
[XMP-photoshop] DateCreated                    : 2017:03:31 22:47:25
[XMP-xmp]      MetadataDate                    : 2017:04:12 13:56:18+03:00
[XMP-xmpMM]    HistoryWhen                    : 2017:04:12 13:56:18+03:00
[IFD0]          ModifyDate                      : 2017:03:31 22:47:25
[ExifIFD]      DateTimeOriginal                : 2017:03:31 22:47:25
[ExifIFD]      CreateDate                      : 2017:03:31 22:47:25
[PNG]          CreationTime                    : 2023:07:06 17:39:17-07:00
[PNG]          CreateDate                      : 2017:03:31 22:47:25
[PNG]          ModifyDate                      : 2017:03:31 22:47:25

StarGeek

You'll have to modify and use the config file in the link provided by greybeard.  The list of tags under the Desire can be edited/expanded to include all the tags you want to check for the earliest data.  Unless you are on a Mac, you can remove the MDItem* tags.  You just have to make sure the number list doesn't skip anything.

Save the code into a file in the same directory as exiftool.  Then the very first option in your command has to be -config ConfigFileName, replacing "ConfigFileName" with the actual name you of the file you saved.

You can then copy the OldestDateTime just like it was any other tag.
"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