ExifTool Forum

ExifTool => Newbies => Topic started by: JayEmBee on March 30, 2023, 10:06:14 AM

Title: Trying to change time only; no success
Post by: JayEmBee on March 30, 2023, 10:06:14 AM
Greetings forum moderators,

I am trying to change the time only with the following command:
exiftool "-CreateDate<${CreateDate;s/ .*/ 00:00:00/g}" temp

I would like to remove all references to time in the file.
I get Warning: No writable tags set from temp error

exiftool -a -G1 -s temp results in:

[ExifIFD]      DateTimeOriginal                : 2016:09:18 21:45:15
[ExifIFD]      CreateDate                      : 2016:09:18 21:45:15

I would like it to read:

[ExifIFD]      DateTimeOriginal                : 2016:09:18 00:00:00
[ExifIFD]      CreateDate                      : 2016:09:18 00:00:00

Thank you advance
Title: Re: Trying to change time only; no success
Post by: Phil Harvey on March 30, 2023, 10:45:45 AM
Your command should work for CreateDate if you are in a Windows cmd shell.  For other shells you need to use single quotes.

- Phil
Title: Re: Trying to change time only; no success
Post by: StarGeek on March 30, 2023, 02:18:08 PM
Alternatively
C:\>exiftool -G1 -a -s -alldates y:\!temp\Test4.jpg
[ExifIFD]      DateTimeOriginal                : 2023:03:30 11:13:50
[ExifIFD]      CreateDate                      : 2023:03:30 11:13:50
[IFD0]          ModifyDate                      : 2023:03:30 11:13:50

C:\>exiftool -P -overwrite_original -d "%Y:%m:%d 00:00:00" -TagsFromFile @ -AllDates y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -alldates y:\!temp\Test4.jpg
[ExifIFD]      DateTimeOriginal                : 2023:03:30 00:00:00
[ExifIFD]      CreateDate                      : 2023:03:30 00:00:00
[IFD0]          ModifyDate                      : 2023:03:30 00:00:00