ExifTool Forum

General => Metadata => Topic started by: rocken on September 21, 2017, 05:28:41 AM

Title: Sync DateTime DateTimeOriginal
Post by: rocken on September 21, 2017, 05:28:41 AM
Hello,
I try to sync DateTime and DateTimeOrioginal.

exiftool "-Software=" "-GPSAltitude=" -DateTime=DateTimeOriginal *.jpg
exiftool "-Software=" "-GPSAltitude=" -DateTime<DateTimeOriginal *.jpg
exiftool "-Software=" "-GPSAltitude=" "-DateTime<DateTimeOriginal" *.jpg
exiftool "-Software=" "-GPSAltitude=" "-DateTime=DateTimeOriginal" *.jpg
exiftool "-Software=" "-GPSAltitude=" "-xmp:DateTime=DateTimeOriginal" *.jpg

but every command tells me:
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in XMP-tiff:DateTime (PrintConvInv)
    0 image files updated
    1 image files unchanged

Does anybody know how to write the command?

Thank you
Title: Re: Sync DateTime DateTimeOriginal
Post by: Hayo Baan on September 21, 2017, 06:30:43 AM
This should work: exiftool "-Software=" "-GPSAltitude=" "-DateTime<DateTimeOriginal" *.jpg (mind the quotes!). Actually better is to use exiftool "-Software=" "-GPSAltitude=" "-DateTime<DateTimeOriginal" -ext JPG instead (see common mistake #2 (https://exiftool.org/mistakes.html#M2)).
It will strip the software and gpsaltitude and set the xmp-tiff:datetime tag to the datetime original.

If this doesn't work, can you show the output of exiftool -G0:1 -DateTimeOriginal for one of those files?

Cheers,
Hayo
Title: Re: Sync DateTime DateTimeOriginal
Post by: rocken on September 21, 2017, 07:21:23 AM
Thank you for your help Hayo Baan,

now the command looks fine and there are no errors :D



I tried the command 'exiftool -G0:1 -DateTimeOriginal xxx.jpg' bevore any cahnges
[EXIF:ExifIFD]  Date/Time Original              : 2017:08:21 08:54:46

also tried 'exiftool -G0:1 -DateTime xxx.jpg'
there is no output

but in irfanview I see a DateTime and DateTimeOriginal in exif and that is not sync.


now I execute 'exiftool "-Software=" "-GPSAltitude=" "-DateTime<DateTimeOriginal" *.jpg'
no errors.

then again 'exiftool -G0:1 -DateTimeOriginal xxx.jpg' after sync.
[EXIF:ExifIFD]  Date/Time Original              : 2017:08:21 08:54:46

and also 'exiftool -G0:1 -DateTime xxx.jpg'
[XMP:XMP-tiff]  Date/Time Modified              : 2017:08:21 08:54:46
( same date as DateTimeOriginal)

but when I open the new synced Image with IrfanView and open the Exif viewer DateTime and DateTimeOriginal are not sync.
Is this an IrfanView error?
Title: Re: Sync DateTime DateTimeOriginal
Post by: Hayo Baan on September 21, 2017, 07:39:38 AM
Could be, but perhaps irfanview simply uses a different tag? (actually, this is very likely since the tag DateTime did not exist before your changes).

Run exiftool -G0:1 -time:all on a file to see all time fields that are present in the file and then search for the one you need to change.
Title: Re: Sync DateTime DateTimeOriginal
Post by: rocken on September 21, 2017, 08:22:07 AM
Thank You,

now I have the command that changes the DateTime and also the modify date:

exiftool "-Software=" "-GPSAltitude=" "-ModifyDate<DateTimeOriginal" "-filemodifydate<DateTimeOriginal" *.jpg

now also the Date is correct shown in IrfanView and also in Windows Explorer - Date modified looks fine.

Thank you for the great and quick help