[one-liner]: How to Manipulate an Image Files Modify/Create Date/Time

Background

Recently I answer a question on superuser.com about how to modify the modify/create time/date on an image file such as a TIFF or PSD formatted file.

Solution

There are basically 2 ways to change the modify/create meta data on a file:

  • From the file-system’s perspective.
  • Within a file’s metadata.

NOTE: If you’d like to follow along here’s a sample PSD file I found from this site


1. Changing file-system modify/create date/time

Windows

Depending on your OS, windows you can use a tool such as File Cosmetic or Finders Keepers. See this techrepublic page for more of them.

File Cosmetic
Finders Keepers
ExifToolGUI

MacOSX

You can use the touch command (man page), similar to other unixes.

For example:

1
2
3
4
5
6
7
8
% touch afile
% ls -l afile
-rw-rw-r-- 1 saml saml 0 Jan 23 22:31 afile
 
% touch -m -t 198001010000 afile
 
% ls -l afile
-rw-rw-r-- 1 saml saml 0 Jan  1  1980 afile

2. Changing the modify/create date/time within file’s metadata

Commandline

You can use the commandline tool, exiftool, to manipulate metadata within various file types such as TIFF & PSD.

1
2
3
4
# DateTimeOriginal before
 
% exiftool '-DateTimeOriginal' -f j.psd 
Date/Time Original              : 2009:05:31 08:32:08
1
2
3
4
# Change the date time
 
% exiftool -overwrite_original "-DateTimeOriginal=1981:07:01 00:00:00" j.psd 
1 image files updated
1
2
3
4
# DateTimeOriginal after
 
% exiftool '-DateTimeOriginal' -f j.psd 
Date/Time Original              : 1981:07:01 00:00:00

NOTE: Further exiftool resources such as the main site & forum along with this thread were useful in getting started..

GUI

You can use the GUI on Windows, ExifToolGUI, to make the same types of changes.

ExifToolGUI

ExifToolGUI

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

This entry was posted in file-format, images, one-liner, Syndicated, tip, tips & tricks. Bookmark the permalink.

Comments are closed.