Change the time of an image

Started by spruce18b, November 08, 2011, 10:44:39 AM

Previous topic - Next topic

spruce18b

I have an image DSC03214.JPG whose date and time are 2011 Jan 9 6:46. The time should be 15:09 with the same date. Could someone please tell me how to do this. Thanks

BogdanH

Hi,

Try:
exiftool -AllDates+=08:23:00 DSC03214.jpg
And if you wish to increment DateTime values for all jpg files in current directory:
exiftool -AllDates+=08:23:00 *.jpg

Bogdan

spruce18b

1. I cannot find in exiftool_pod.pdf a definition of AllDates. Does it refer to all the date types? Which date types are defined as Date Picture Taken and Date modofied, respectively?  Where can I find these tags defined?
2. How do I change the date without changing the time? For example, how do I change the date 2011 Jan 9 6:46 to 2011 Jan 19 6:46 for file DSC03214.JPG without changing the time? Thanks

Phil Harvey

The AllDates tag is a Shortcut for the three common date/time tags.

See Shift.pl for a complete description of the shift syntax.  But to save you some reading, use "+=10 0" to shift a date/time value forward by 10 days.

- 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 ($).

spruce18b

I have tried several ways to move the createDate of an image backwards by 8 minutes but I can't get the syntax correct. Could you please tell me what I'm doing wrong? And where can I find examples of syntax besides exiftool_pod.pdf or http://search.cpan.org/dist/Image-ExifTool/lib/Image/ExifTool/Shift.pl? Please see screen dump showing my errors below. Thanks

C:\DATA\Pictures\SAmerica2011\Reduced\temp>c:\apps\exiftool\exiftool.exe -createDate-=0 0:08:00 DSC03311.JPG
Error: File not found - 0:08:00
    0 image files updated
    1 image files unchanged
    1 files weren't updated due to errors

C:\DATA\Pictures\SAmerica2011\Reduced\temp>c:\apps\exiftool\exiftool.exe -createDate -=0 0:08:00 DSC03311.JPG
File not found: 0:08:00
======== DSC03311.JPG
Create Date                     : 2011:01:10 08:49:19
    1 image files read
    1 files could not be read

C:\DATA\Pictures\SAmerica2011\Reduced\temp>c:\apps\exiftool\exiftool.exe -createDate-= 0 0:08:00 DSC03311.JPG
Error: File not found - 0
Error: File not found - 0:08:00
    0 image files updated
    1 image files unchanged
    2 files weren't updated due to errors

BogdanH

Hi,

That's your command:
exiftool -createDate-=0 0:08:00 DSC03311.JPG

Here's correct command:
exiftool -createDate-=00:08:00 DSC03311.JPG
..where shift amount is =hh:mm:ss

In your command, there was blank (space) character after first zero. For Exiftool, this means parameters (for -createDate) ends here and that next parameter (0:08:00 in your case) is name of file (which, obviously, doesn't exist).

Bogdan

spruce18b

I thought that the zero was necessary as a place holder for date.

Phil Harvey

#7
Any of these should work:

c:\apps\exiftool\exiftool.exe -createDate-="0 0:08:00" DSC03311.JPG

c:\apps\exiftool\exiftool.exe -createDate-=0:08:00 DSC03311.JPG

c:\apps\exiftool\exiftool.exe -createDate-=0:08 DSC03311.JPG

c:\apps\exiftool\exiftool.exe -createDate-=:8 DSC03311.JPG

See the shift documentation for details about the shift strings. [Oh, I see you know about this already.]  The placeholder isn't necessary when shifting a time.  The documentation, however, doesn't discuss the quoting that is necessary for the command line.  If an argument contains a space, it must be quoted as I have done above.

- 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 ($).

JanK

spruce18b I suggest to use AllDates. Not only createDate. The date/time on which you pushed the cameras button is stored in DateTimeOriginal. But to correct a wrong time of your camera always use AllDates.
-Mac OSX Mountain Lion-

ruedigers

Very, Very useful information!  :D  Is this already in the FAQ, if not, I might be worth going there!  8)

Phil Harvey

Quote from: ruedigers on November 29, 2011, 09:12:25 AM
Very, Very useful information!  :D  Is this already in the FAQ, if not, I might be worth going there!  8)

There is currently no FAQ which discusses date/time shifting, but if you are talking about the AllDates tag, this is mentioned on the ExifTool home page.

- 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 ($).

spruce18b

I have an error message that doesn't make sense. I want to subtract one day from the date when a picture was taken. Could someone please tell me how to correct it? Thanks, Bill

C:\DATA>c:\apps\exiftool\exiftool.exe -DateTimeOriginal-='0:0:1 0:00:0' DSC00347.JPG
Error: File not found - 0:00:0Æ
    1 image files updated
    1 files weren't updated due to errors

BogdanH

Hi,

On Windows, you should use double quotes:
-DateTimeOriginal-="0:0:1 0:00:0" DSC00347.JPG

Bogdan

JanK

And you should use -AllDates not only -DateTimeOriginal
-Mac OSX Mountain Lion-

Phil Harvey

Quote from: spruce18b on December 15, 2011, 11:00:05 PM
C:\DATA>c:\apps\exiftool\exiftool.exe -DateTimeOriginal-='0:0:1 0:00:0' DSC00347.JPG
Error: File not found - 0:00:0Æ
    1 image files updated
    1 files weren't updated due to errors

FYI: The result of this (improperly quoted) command was to subtract 1 second from the DateTimeOriginal of DSC00347.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 ($).