EXIFTIME(1) | General Commands Manual | EXIFTIME(1) |
exiftime - display or adjust date & time Exif tags; list files ordered by their Exif date & time tags
exiftime [-filqw] [-s delim] [-t[acdg]] [-v[+|-]val[ymwdHMS]] file ...
When invoked without arguments, the exiftime utility displays the Exif date and time tags contained in each input file to the standard output. Otherwise, depending on the options specified, exiftime will operate on only the chosen tags, will adjust the date and time, will write an adjusted time to each file, or will list each file in ascending order by date and time.
Most digital cameras include one or more date and time tags in the Exif data added to the image files they produce. These tags are:
The format for these tags is "YYYY:MM:DD HH:MM:SS" with the time shown in 24-hour format. The exiftime utility cannot add a tag if it does not already exist in file.
By default, exiftime will simply print out any of the three date and time flags in each input file. The -l flag will produce a listing of each input file in date/time order, suitable for use in further image processing (e.g., production of a Web catalog) when filename ordering is not useful.
The -v flag may be used to vary, or adjust, dates and times. When used with the -w flag, which writes the adjusted date and time to each input file, one may, for example, process a batch of files to adjust for a camera's incorrectly set clock.
When providing an absolute value (rather than a relative adjustment), seconds are in the range 0-59, minutes are in the range 0-59, hours are in the range 0-23, month days are in the range 1-31, week days are in the range 0-6 (Sun-Sat), months are in the range 1-12 (Jan-Dec) and years are in the range 80-38 or 1980-2038.
If val is numeric, one of either y, m, w, d, H, M, or S must be used to specify which part of the date is to be adjusted.
The week day or month may be specified using a name rather than a number. If a name is used with the plus (or minus) sign, the date will be put forwards (or backwards) to the next (previous) date that matches the given week day or month. This will not adjust the date, if the given week day or month is the same as the current one.
When the date is adjusted to a specific value that doesn't actually exist (for example March 26, 1:30 BST 2000 in the Europe/London timezone), the date will be silently adjusted forwards in units of one hour until it reaches a valid time. When the date is adjusted to a specific value that occurs twice (for example October 29, 1:30 2000), the resulting timezone will be set so that the date matches the earlier of the two times. In all cases, daylight savings time considerations are ignored.
Refer to the examples below for further details.
The command
exiftime example1.jpg
will display:
Image Created: 2003:09:12 17:05:37 Image Generated: 2003:09:12 17:05:37 Image Digitized: 2003:09:12 17:05:37
The command
exiftime -tcd example1.jpg
will display:
Image Created: 2003:09:12 17:05:37 Image Digitized: 2003:09:12 17:05:37
The command
exiftime -v+3H example1.jpg
will adjust each time forward by three hours and display:
Image Created: 2003:09:12 20:05:37 Image Generated: 2003:09:12 20:05:37 Image Digitized: 2003:09:12 20:05:37
The command
exiftime -v+5d -v-7M -fw -tg *.jpg
will adjust the date ahead five days and the time back seven minutes and write the adjusted date and time to the Image Generated tag without a prompt for confirmation for all files that match "*.jpg". It displays:
example1.jpg: Image Generated: 2003:09:12 17:05:37 -> 2003:09:17 16:58:37 example2.jpg: Image Generated: 2004:01:22 17:07:02 -> 2004:01:27 17:00:02
The command
exiftime -l -tdg *.jpg
will list all files that match "*.jpg", one per line, in ascending timestamp order. It'll attempt to use the following timestamp values, in order: Image Digitized, Image Generated, Image Created, and, finally, the OS's epoch.
The exiftime utility exits 0 on success and 1 if an error occurs.
The exiftime utility was developed using the 2003 draft Exif standard, version 2.21 (http://tsc.jeita.or.jp/).
Does not support the Exif tags SubsecTime, SubsecTimeOriginal, or SubsecTimeDigitized. Does not support manufacturer-specific date and time tags.
The exiftime utility and this man page were written by Eric M. Johnston <emj@postal.net>. The time adjustment functionality and documentation were derived from portions of FreeBSD's date(1) command by Brian Somers <brian@Awfulhak.org>.