[Solved] Getting Invalid date/time setting DateTimeOrig but format is correct

Started by UCLAGeek, August 06, 2013, 02:34:01 PM

Previous topic - Next topic

UCLAGeek

Hi,

I'm using OSX I know exiftool can not read the files creation date so I'm writing a bash script that will take the system Creation Date and tell exiftool to add that date to the file.

This is the format of the date 2013:08:06 10:08:06. Here's my code:

exiftool '-EXIF:DateTimeOriginal='2013:08:06 10:08:06' ' test.jpg
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv)
Nothing to do.


I'm not sure where I'm screwing up. Does the DateTimeOriginal require and offset for the time zone?

UCLAGeek

Figured it out.

here's the code if anyone is interested:

exiftool -xmp:dateTimeOriginal='2013:08:06 10:08:06' ' test.jpg

Phil Harvey

I think you still have an extra quote.  It should be:

exiftool -xmp:dateTimeOriginal='2013:08:06 10:08:06' test.jpg

which will work on Mac/Linux.  Or this, which will work on any system:

exiftool -xmp:dateTimeOriginal="2013:08:06 10:08:06" test.jpg

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).