# How to shift EXIF date/time created by time in days, hours, minutes?

I have two camera bodies, I was shooting while on vacation, when I downloaded the photos to lightroom, one body was set to the correct date/time, the other was off by 722 days, 4 hours, 32 minutes.

Is there a tool available that can help me fix the date/time so that they appear in sequence while browsing my lightroom library? I'd like for them to be as close to the right time.

I was able to adjust created year, month, date, but it doesn't appear lightroom will allow me to adjust increments (only hour increments).

Many thanks if you can help me in this task!

-
Possible duplicate: photo.stackexchange.com/questions/2973/…. –  jrista Jan 30 '11 at 23:05
Possible duplicate: photo.stackexchange.com/q/1473/21 –  Rowland Shaw Jan 31 '11 at 13:09
Not a duplicate of photo.stackexchange.com/questions/2973/… — that's about creating an EXIF timestamp when none exists. –  mattdm Jan 31 '11 at 13:46
And photo.stackexchange.com/questions/1473/… is too lightroom-specific. –  mattdm Jan 31 '11 at 13:47
Go set the clock in that second camera now before you forget and make another mess. Also, if you use a GPS with any of your cameras, there may be the option to have the camera clock automatically sync off the GPS clock. Now if only you could upload a timezone map and have the camera not only set the clock from the GPS, but determine the timezone from the lat/lon and apply it automatically. It amazes me the GPS units with maps already built in don't routinely do this. The extra data is tiny compared to the map data. –  Olin Lathrop Jun 24 '13 at 16:21

Lightroom will change the date/time easily by selecting the image you know the proper time for, then select all others to be changed - similar to how develop sync settings works.

After the selection is made, click

Select Change to a specified date and time

Enter the proper date and time for that one image, Lightroom will adjust all other selected images based on the proper time you define you enter.

-
The only problem with this is that Lightroom can't change the EXIF parameter "Date Time Digitized" and "Date Time". It only changes "Date Time Original" which is the same as "Date created" in IPTC, or "capture time" as seen in the Default metadata preset. –  sammyg May 4 '14 at 12:18
So LR is not changing all metadata elements. And even if that would be possible, it only stores the changes in the catalog, not in the original files. You can export the images to new files, but not everything will be changed. It can save metadata to original file (Ctrl+S or Metadata menu). But doesn't work for CR2 RAW files, it only produces XMP sidecar files. Even when you set the "write date or time changes into proprietary raw files" option, it still produces XMP sidecar files (possible bug). –  sammyg May 4 '14 at 12:20
In short, Lightroom is useless at modifying this metadata information if you wish to save this out to the original files. It only works within Lightroom catalogs. I personally feel like this should be permanently set and saved in the original files, since this is a mistake made at the time the photos were captured (e.g. time zone shift or daylight saving mistake or multi-camera mismatch). –  sammyg May 4 '14 at 12:23

You can set, increment, and decrement Exif-Date (and File-Dates) with the following tools:

XnView (Windows)

1. [mark pictures to be adjusted]
2. Tools -> Change Timestamp

ExifTool (Windows and Mac OSX)

1. exiftool "-AllDates+=1:12:28 14:54:32" -verbose *.jpg to adjust all JPG image dates by adding 1 year, 12 month, 28 days, 14 hours, 54 minutes, 32 seconds
2. You can apply the change to all images in a folder or conditionally based on fields

Exifer (Windows)

1. [mark pictures to be adjusted]
2. (fails with newer JPG) ... I don't remember the commands
-
To just add or subtract 1 hour with exiftool, it's enough to just type exiftool -AllDates+=1 path\filename.jpg (to add) or exiftool -AllDates-=1 path\filename.jpg (to subtract). To perform the same operation on all files in a given folder one can use wildcard characters like *.jpg to process all files with the JPG extension, or *.* to process all files in a given folder. –  sammyg May 9 '14 at 21:29

Using Picasa (3.8) it's very easy to either shift or set the date of a batch of photos. And it's cross-platform (Windows, OSX and Linux) and free. And no terminal fiddling...

1. Open Picasa
3. Click Tools > Adjust Date and Time
4. Fill in as required (see screenshot)

-
GUI fiddling instead of terminal fiddling. :) –  mattdm Jan 3 '12 at 20:49
Actually, I downloaded, installed and tried exiftool(sno.phy.queensu.ca/~phil/exiftool) on OSX first, but I couldn't get it to work properly. I was able to batch shift the Last Modified date, but trying to change the other ones (creation date etc), all resulted in setting it to now(). I probably could have spend another half hour browsing the exiftool man pages, but picasa was much quicker to understand and use... –  Rabarberski Jan 3 '12 at 20:55
I'm mostly kidding. But for command line things like this, jhead is easier than the all-powerful exiftool. –  mattdm Jan 3 '12 at 21:01

A trick I use to sync different cameras used on a trip is to take a simultaneous photo - then you know exactly what the offset is and you don't have to guess. This is particularly helpful when some cameras are owned by others and they have no clue how to set the time.

I've taken to setting all my cameras to UTC so there's never any question of what the "correct" time is, and it doesn't vary between time zones.

-
Or take a photo of a clock synced to an accurate time server (a cell phone should do) with both cameras. –  mattdm Aug 14 '11 at 23:50
That's what I would suggest. If possible, I take a picture of the time.is page. –  texnic Nov 2 '13 at 14:00

The simple command-line program jhead is great for this. It's completely free (and open source) and is easily available for Windows, Mac, or Linux. If you're not used to command-line programs, this is a pretty non-intimidating one because there's not a lot to it. You have to format the dates correctly, but it's easy to do by following the examples (see the documentation I've included below).

It has a simple adjust by-hours command, but for big changes it also has an old -> new syntax which computes the difference for you (so you don't have to worry about leap years and so on). If you happen to have the wrong-set camera still at hand and still wrong, I find it handy to take a shot of a (time-synced) digital clock — then, take the date shown in the picture as "newdate" and the date in the metadata as "olddate" for the parameters below.

From the documentation:

   -ta<+|-><timediff>
Adjust time stored in the Exif header by h:mm backwards or  for-
wards.   Useful  when  having taken pictures with the wrong time
set on the camera, such as after travelling across  time  zones,
or when daylight savings time has changed.

This  option  changes  all  Date/time fields in the exif header,
including "DateTimeOriginal"  (tag  0x9003)  and  "DateTimeDigi-
tized" (tag 0x9004).

-da<newdate>-<olddate>

Works  like  -ta,  but  for specifying large date offsets, to be
used when fixing dates from  cameras  where  the  date  was  set
incorrectly,  such  as  having  date  and  time reset by battery
removal on some cameras

Because different months and years  have  different  numbers  of
days in them, a simple offset for months, days, years would lead
to unexpected results at times.  The time offset is thus  speci-
fied as a difference between two dates, so that jhead can figure
out exactly how many days the timestamp needs to be adjusted by,
including  leap  years  and  daylight savings time changes.  The
dates are specified as yyyy:mm:dd.  For sub-day  adjustments,  a
time of day can also be included, by specifying yyyy:nn:dd/hh:mm
or yyyy:mm:dd/hh:mm:ss

Examples:

Year on camera was set to 2005  instead  of  2004  for  pictures
taken in April

Default  camera  date  is  2002:01:01,  and  date  was  reset on
2005:05:29 at 11:21 am


-

This is very helpful, it shows many available tools:

http://petapixel.com/2012/11/05/how-to-fix-your-timestamps-if-you-forgot-to-update-your-camera-for-daylight-savings/

namely how to use Adobe Lightroom, Picasa, Jhead, ExifTool and Exifer to shift the date.

Personally I use ExifTool, and Exiv2, which works on MacOSX to do the following in the terminal:

find . -name '*.JPG' -exec bash -c 'mv "$1" "${1/%.JPG/.jpg}"' -- {} \;
exiftool “-DateTimeOriginal+=0:1:2 3:4:5″ .
exiv2 -r'Some_words_%Y%m%d_%H%M%S' rename *.jpg


Which renames all '.JPG' files to '.jpg', shifts the date of all photos in current folder forward 0 years 1 month 2 days 3 hours 4 minutes and 5 seconds, then renames all photos in the current folder to "Some_words_" followed by the date and time. E.g. "Some_words_20130625_1554.jpg"

To install exiv2 you should be able to

brew install exiv2


if you use brew, and I was pointed here for ExifTool

-

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Thanks for the tip, it works perfectly on Linux (Ubuntu). If you simply want to shift by 1 hour every photo in the current directory, the following command is enough: exiftool "-DateTimeOriginal-=0:0:0 1:0:0" . –  Xavier Dec 24 '14 at 14:35

If you use windows, Windows Live Photo Gallery has this feature where you can 'move' the time of a group of photos by a certain period.

-
My apologies, should have mentioned mac platform. –  Canon Gangsta Jan 30 '11 at 21:52

By far the easiest trick is to take a picture of a clock with all the camera's you took on your trip. Then correct the time by copying the time on the clock in the picture. Read on how I did this in iPhoto (this can also be done in Picasa. Not sure about Lightroom and Aperture):

http://rolfje.com/2011/08/15/fixing-photo-creation-dates/

-