Main Menu

Date Time Change

Started by Archive, May 12, 2010, 08:53:54 AM

Previous topic - Next topic

Archive

[Originally posted by linuxuser on 2006-05-26 18:13:19-07]

I have used 2 cameras with different time settings and therefore I have to change _all_ date and time fields of the pictures of 1 camera. All the times have to be set about 1 hour later, exactly 1:02:19. Do I need to write a bash-script to do this or can that be done with an exiftool-command directly? Please note, it could happen, that the date has to be changed too, e.g. if the original time is something like 23:10.

Archive

[Originally posted by exiftool on 2006-05-26 20:17:29-07]

This can be done with a single command.  First you need to determine which date/time tags you want to change.  If we are talking about JPEG images, this is likely DateTimeOriginal, ModifyDate and CreateDate, although you might want to set the FileModifyDate as well.  You can do this with:

Code:
   exiftool -datetimeoriginal+=1:02:19 -modifydate+=1:02:19 -createdate+=1:02:19 DIR

where DIR is the name of a directory containing the images to update.  This will properly handle incrementing the date if necessary, taking into account leap years, etc.  ...it's pretty smart. Wink

- Phil

Archive

[Originally posted by linuxuser on 2006-11-17 16:26:21-08]

How do I have to write a difference in years, e.g. the current value of the picture is "1980:01:01 00:01:59" and I would like to have "2006:11:17 15:30:00" and all the other pictures with a later time should have the same difference.

Archive

[Originally posted by exiftool on 2006-11-17 17:36:09-08]

The date/time shift syntax is all explained in some detail
here,
but I realize this is a bit complex.

Basically, you want to add 26 years, which can be done with
a shift value of:

Code:
"26:0:0 0"  or "26:: 0"

So, assuming you want to shift DateTimeOriginal, CreateDate and
ModifyDate for all images in directory DIR with dates before the year
2000, you would do this:

Code:
exiftool "-alldates+=26:: 0" -if "$createDate lt 2000" DIR

Note that you will need to use single quotes for the 2nd argument
if you are using a Unix shell.  Also note that you must be using
ExifTool 6.50 or later to use the "-if" option.

I hope this helps.

- Phil