34

I use F-Spot to manage my images. For one set of images, the dates somehow got messed up and they all are marked as September 1st 2007. I'd like to change the date taken information to a different date. How can I do this?

11 Answers 11

29

jhead is capable of doing this.

Let's say you know a certain picture was taken on 2017-04-19 16:20 but the current date is showing as 2007-09-01 00:15, you can adjust all jpg pictures in a folder to the correct time by doing:

jhead -da2017:04:19/16:20-2007:09:01/00:15 *.jpg

Here is an extract from the manual:

DATE / TIME MANIPULATION:
   -ft        Set file modification time to Exif time
   -dsft      Set Exif time to file modification time
   -n[format-string]
             Rename files according to date.  Uses exif date if present, file
             date otherwise.  If the optional format-string is not supplied,
             the format is mmdd-hhmmss.  If a format-string is given, it is
             is passed to the 'strftime' function for formatting
             In addition to strftime format codes:
             '%f' as part of the string will include the original file name
             '%i' will include a sequence number, starting from 1. You can
             You can specify '%03i' for example to get leading zeros.
             This feature is useful for ordering files from multiple digicams to
             sequence of taking.  Only renames files whose names are mostly
             numerical (as assigned by digicam)
             The '.jpg' is automatically added to the end of the name.  If the
             destination name already exists, a letter or digit is added to
             the end of the name to make it unique.
  -nf[format-string]
             Same as -n, but rename regardless of original name
  -a         (Windows only) Rename files with same name but different extension
             Use together with -n to rename .AVI files from exif in .THM files
             for example
  -ta<+|->h[:mm[:ss]]
             Adjust time by h:mm backwards or forwards.  Useful when having
             taken pictures with the wrong time set on the camera, such as when
             traveling across time zones or DST changes. Dates can be adjusted
             by offsetting by 24 hours or more.  For large date adjustments,
             use the -da option
  -da<date>-<date>
             Adjust date by large amounts.  This is used to fix photos from
             cameras where the date got set back to the default camera date
             by accident or battery removal.
             To deal with different months and years having different numbers of
             days, a simple date-month-year offset would result in unexpected
             results.  Instead, the difference is specified as desired date
             minus original date.  Date is specified as yyyy:mm:dd or as date
             and time in the format yyyy:mm:dd/hh:mm:ss
  -ts<time>  Set the Exif internal time to <time>.  <time> is in the format
             yyyy:mm:dd-hh:mm:ss
  -ds<date>  Set the Exif internal date.  <date> is in the format YYYY:MM:DD
             or YYYY:MM or YYYY

An even more powerful option is ExifTool.

4
  • Recently used jhead to correct and synch the date/time stamps on hundreds of pictures from a family vacation where three cameras all had the data and time incorrectly set. Easy to use and quite useful.
    – Will M
    May 9, 2010 at 21:00
  • Jhead doesn't seem to support RAW file types, but ExifTool does (e.g. Canon CR2, Nikon NEF, Sony ARW). This is good to know, for those of us who either shoot only in RAW or both RAW and JPEG.
    – Samir
    May 4, 2014 at 10:50
  • Is it compatible with Windows 10?
    – XPMai
    Jun 24, 2018 at 7:13
  • @XPMai Still works with Windows 10 - I ended up using -ds for my purposes. May 22, 2019 at 14:08
5

Picasa has this built-in. Tools => Adjust Date and Time....

3
4

exiv2 is a command line tool to manipulate exif data. Supported image formats are JPEG, Canon CRW and Canon THM. PNG is read-only.

If you want to set the file date to the exif date you can use exiv2 with the following option.

-t Set the file timestamp according to the Exif create timestamp in addition to renaming the file (overrides -k). This option is only used with the ’rename’ action.

1
  • thanks! exiv2 is easy to use and quick. -T allows to set the file timestamp without file renaming :)
    – orzechow
    Sep 8, 2015 at 13:07
2

Try FastStone Image Viewer [features, download link 1, download link 2]

a screenshot

1
  • It actually converts the image, instead of just adding meta data right?
    – XPMai
    Jun 24, 2018 at 7:15
2

Here is what I needed

To add constant offset to old date

exiv2 ad -a -3:17 *.JPG

To rename into %Y%m%d_%H%M%S

exiv2 mv *.JPG

Other formats and options are specified in man pages.

1

I use a following script to give images some successive dates. Hope it helps. It expects a directory with the images to be redated as an argument i .e script directory_with_images

#!/bin/bash
HOUR=12
MINUTE=0
DATE=2004:06:20
for file in "$1"/*;
do 
    exiv2 -v -M"set  Exif.Image.DateTime $DATE $(printf %02d $HOUR):$(printf %02d $MINUTE):00" "$file"
    exiv2 -v -M"set  Exif.Photo.DateTimeDigitized $DATE $(printf %02d $HOUR):$(printf %02d $MINUTE):00" "$file"
    exiv2 -v -M"set  Exif.Photo.DateTimeOriginal $DATE $(printf %02d $HOUR):$(printf %02d $MINUTE):00" "$file"
    #sets file timestamp (i.e. filesystem metadata, not image metadata) as well
    exiv2 -v -T "$file"
    if [ $MINUTE = 59 ]; then
        HOUR=$((HOUR + 1))
        MINUTE=0
    else
        MINUTE=$((MINUTE + 1))
    fi
    # this would rename the file as well
    #new_path=`pwd`/new_filename$(printf %02d $HOUR)$(printf %02d $MINUTE).jpg
    #cp "$file" "$new_path"
done
0

iPhoto and Aperture both have a time-shift option, for when you're in a new time-zone usually, or the clock is wrong. It can either leave the files unedited (only updating the App's db) or edit the files. Clearly F-Spot needs to borrow this.

0

Exiftool: slow on the command line. (It's written in Perl, so draw your own conclusions there.)

Exifer creates an empty tag or two in files, and not just in the EXIF block. It will also remove some tags written by other tools. As I haven't used it in over a year, I can't be specific as to which ones.

FastStone's stuff, imx, is too slow to keep installed for more than a day or two.

My vote is for Hr. Weinzerl's suggestion: Exiv2.

BZT

0

Picasa 3, a free photo management tool from Google, will do this and it's nice and quick.

In Picasa select View menu > Properties to display the Properties pane.

Select the folder containing the photos and they'll appear as a collection of thumbnails.

Select the thumbnails you want to update. To decide which to update as a batch, you can either set them all to the same new date-time or you can change the first one and all the rest will be time-shifted by the same amount.

In the Properties pane right click on the Camera Date field then select Adjust Date and Time... from the context menu. The Adjust Photo Date dialog will open showing the current Camera Date for the first photo.

Edit the Camera Date and Time as required. If you just want to change a.m. to p.m., or vice versa, just select the "a.m." part of the time and type "a" or "p" as appropriate. No need to type the whole "a.m." or "p.m." thing.

There are two options, if you selected more than one thumbnail for updating: "Adjust all photo dates by the same amount" or "Set all photos to the same date and time". Choose whichever is appropriate. Then click OK.

The EXIF dates of all the selected photos will be updated.

2
  • See earlier answer by @user28515 that also suggests Picasa; sadly it is no longer available.
    – JohnC
    Dec 6, 2018 at 3:52
  • Although Picasa is no longer being developed by Google and they've removed the installer from their website it's still possible to download the last version, v3.9. Googling "download picasa 3.9" will give plenty of hits. If you're leery of downloading from a random site the official Google download is still available via the Internet Archive Wayback Machine. For more info see here: sites.google.com/site/picasaresources/Home/Picasa-FAQ/picasa/…
    – SimonTewsi
    Dec 6, 2018 at 21:21
0

For anyone using Windows 10: making mass changes to certain meta data is built into File Explorer.

  • Select the photos you'd like to update in File Explorer
  • Right-click on a selected photo and open Properties
  • Assuming you have only photos selected, the Details tab will allow you to make changes

This only works for assigning the same value (e.g. Date Taken) to each photo you selected.

0

Set to oldest date from Exif meta or file name

Step 0 - install exiftool from below

Installing ExifTool

👉 Step 0.1

Save the oldest_datetime_config in the home folder C:\Users\YOURUSERNAME or in your home directory ~ or in the same folder where you have installed exiftool. This step is important for the following steps to be successful.

You can find these in a script here but I have found that running the commands in the pic folder I mentioned in the options below are much much faster than running these through python script exif-scripts/setToOldestDate.py For faster processing you can run these commands directly in powershell from the pic folder you are planning.

If you are running WSL then run these commands from poweshell and not WSL are the file system read write from the windows virtualization will blow up your ram and will slow down the process to a halt.

🦺 Note that these scripts are recursive and will affect all the subfolders are well.

Well … now — pick your options:

Option 1 - In case you need to pick the date from the file name.

This is pretty flexible and fuzzy parser from exiftool but if you want it to be absolutely sure then you can remane the file to include yyyymmdd_hhmmss and remove all the other number before it (after is OK).

exiftool "-FileModifyDate<filename" −overwrite_original -S -m -progress -ee -q -q ./

Option 2 - set all the dates to the oldest date

exiftool -overwrite_original "-FileModifyDate<OldestDateTime" "-ModifyDate<OldestDateTime" "-DateTimeOriginal<OldestDateTime" "-CreateDate<OldestDateTime" "-GPSDateTime<OldestDateTime" -S -m -progress -ee -q -q ./

Option 3 - set the name of the file in PXL_yyyymmdd_hhmmss-[number-if-conflict].extension

exiftool "-filename<OldestDateTime" -d PXL_%Y%m%d_%H%M%S%%-c.%%e -S -m -ee -progress -q -q ./

to push all the files in the current directory use

adb push -a . /sdcard/DCIM/Camera/

-a is to preserve the attributes.

⌛ Refresh Android Media Store

As a last step, you need to refresh the android media store database to let google photos know which new files to backup. Currently it does not always detect automatically so why wait for that. Install Refresh MediaStore and run it after the adb push is complete from the phone. Then you can open Google Photos and see that the backup is starting.

2
  • Why all these bold case characters?
    – Toto
    Aug 1 at 18:21
  • Some markdown issue.
    – Pratyush
    Aug 3 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.