Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

How to fix incorrectly set EXIF datestamps UNIX
I recently returned from a trip to Hong Kong and neglected to set the clock on my digital camera to local time there. When going through hundreds of photos at home and trying to figure out places and dates the EXIF information is a huge help, but not if it's showing EST for pictures taken in Hong Kong! Having also had this date skew problem with system logs, I knew there had to be a quick way to fix them all. jhead to the rescue!

jhead, which is free and in the public domain, will let you do this and many more great things to/from EXIF information. See this hint which also uses jhead and covers installation.

The relevant option to fix timestamps is the -ta option:
  -ta(+|-)h[:mm] -->  Adjust time by h:mm backwards of forwards.  Useful
        when having taken pictures with the wrong time set on the camera,
        such as when travelling across time zones or DST changes.
Another handy thing you can do with jhead:
  -ft   -->  Set file modification time to Exif time.
[robg adds: I haven't had a reason to use jhead yet, but it's on my hard drive just in case!]
  • Currently 3.60 / 5
  You rated: 4 / 5 (5 votes cast)

How to fix incorrectly set EXIF datestamps | 8 comments | Create New Account
Click here to return to the 'How to fix incorrectly set EXIF datestamps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to fix incorrectly set EXIF datestamps
Authored by: merlyn on Mar 30, '04 12:22:13PM
Hmm. I wrote this little Perl script to do the same thing:

use strict;

use Image::EXIF;
use Time::Local;

for (@ARGV) {
  my $exif = Image::EXIF->new($_) or next;
  my $info = $exif->get_image_info() or next;
  my $created = $info->{"Image Created"} or next;
  my @digits = $created =~ /(\d+)/g or next;
  $digits[0] -= 1900;
  $digits[1] -= 1;
  my $gmtime = timegm(reverse @digits);
  if ($gmtime > time or $gmtime < time - 86400*30) {
    warn "preposterous gmtime for $_", scalar gmtime;
  utime($gmtime, $gmtime, $_) or warn "Cannot utime on $_: $!";
Requires Image::EXIF from the CPAN (install via perl -MCPAN -eshell).

Also note that I always keep my camera on GMT, because I never have to remember to set it that way. {grin}

[ Reply to This | # ]

Another option
Authored by: globeriding on Mar 30, '04 02:32:28PM
Another option is to check out an app called Photoinfo , which has a GUI for all us non UNIX heads. It's a great app, and the developer is very responsive- even emailed me a beta with a feature I needed to test.

[ Reply to This | # ]
How to fix incorrectly set EXIF datestamps
Authored by: MartySells on Mar 30, '04 08:11:40PM

This only fixes the file timestamps, not the EXIF version which makes sense if you always keep the EXIF ones pointing to GMT. Smart trick keeping the camera on GMT :) -m

[ Reply to This | # ]
How to fix incorrectly set EXIF datestamps
Authored by: MartySells on Mar 30, '04 08:14:47PM
By 'this' I meant merlyn's script. I checked out Image-EXIF on CPAN and don't see that it supports setting EXIF info. -m

[ Reply to This | # ]
¡Just Use GMT!
Authored by: ?alabio on Mar 30, '04 11:18:50PM

I have every timekeeping device set to use GMT. ¿Why do you make so much trouble for yourself? Also, have your MacIntosh use NetworkTimeProtocol.

[ Reply to This | # ]
But how do I make iPhoto recognize it?
Authored by: derrickbass on Mar 31, '04 12:20:40AM

I have some photos like this, but iPhoto doesn't notice when I change the EXIF data. The only thing I can do is change them one at a time in iPhoto itself, which is just not going to happen. Is there a way to make iPhoto notice the changes?

(BTW, I don't have iPhoto 4; perhaps it works better there?)

[ Reply to This | # ]
Samsung D900 camphone stores date incorrect
Authored by: tieneus on Oct 11, '07 08:20:30AM
My Samsung D900 camera-phone stores the dates in the EXIF always as 1-1-2006 (or so)

Simply use jhead -dsft *.jpg on the files to set
the EXIF date to the file creation-date so that for instance
iphoto can organize your photos correctly. :-)

[ Reply to This | # ]
Nokia 6133 camphone doesn't store EXIF date at all
Authored by: improbable on May 27, '08 09:59:26PM

I have the same problem with my Nokia: no EXIF date, only a file date (which is actually the time downloaded, not time shot.) But I couldn't get jhead to work for me.

With ExifTool, the command I'm using is
exiftool -P '-DateTimeOriginal<FileModifyDate' *.jpg
which I think does the same thing. -P tells it not to adjust the file's time.

Incidentally the reason I want this is that, while Aperture falls back to using the file's time if there's no EXIF time, Lightroom does not. I don't know about iPhoto.

[ Reply to This | # ]