Lubos Rendek

The only solution is determination.

Extract DATE From a Photo Image Using Exiftool

| Comments

Very useful tool when one needs to get in EXIF data from an image/photo is to use exiftool. By default exiftool extract all information from an image. If only date is required we can grep through the out information and extract only date and or file name. One approach would be to simply use:

1
$ exiftool -common directory

to get the output. However, there are two problems. First the data output is not chronologically sorted and second it outputs more information than required. The command bellow will strip the unnecessary data from the output and sort from oldest to newest. Make sure that you are located in the directory from which you are running the below command:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ for i in $(ls | sort); do exiftool -common $i | grep -E "File Name|Date"; done
File Name                       : DSC00639.JPG
Date/Time Original              : 2010:03:04 11:09:17
File Name                       : DSC01408.JPG
Date/Time Original              : 2010:04:13 12:01:03
File Name                       : DSC02366.JPG
Date/Time Original              : 2010:09:06 12:41:31
File Name                       : DSC03990.JPG
Date/Time Original              : 2011:02:07 14:56:43
File Name                       : DSC05060.JPG
Date/Time Original              : 2011:04:21 12:02:53
File Name                       : DSC05370.JPG
Date/Time Original              : 2011:06:24 12:30:53
File Name                       : DSC06019.JPG
Date/Time Original              : 2012:06:09 17:03:05
File Name                       : DSC07919.JPG
Date/Time Original              : 2012:09:16 12:39:26
File Name                       : DSC08459.JPG
Date/Time Original              : 2013:02:10 11:40:31
File Name                       : DSC09922.JPG
Date/Time Original              : 2014:03:30 10:27:21

Comments