Photograph dates

23 09 2007

Today I was trying to get some photographs in the right chronological order. I use a tool, Exif Pilot, that can change the dates that are incorporated in most jpeg’s created with a digital camera. And another one, Flash renamer, that can rename the jpeg files based on the dates contained in the file. The last tool is not so necessary any more as a lot of file managers (both windows and linux world) can detect these dates as well. But when you rename a file and let it start with a date and time, a simple ‘dir’ or ‘ls’ lists the files in the ‘correct’ order.

There is one problem with all this. That is when you, or the person operating the digital camera, forget to set the right date and time in the camere when taking the photographs. Hence Exif pilot to change the dates in the jpeg file.

Exif Pilot change date dialogThere is however a quirk in this tool as you can see in the date dialog. When you have multiple files that have an incorrect date but are in the right chronological order, you can add or substract a number of days, hours, minutes and/or seconds. All you then have to do is figure out what the interval is between the date and time the camera has been set to and the actual date the photograph was taken. You probably can find out what the actual date has been. But then calculating the interval! That means finding a calendar and counting the days. Especially fun when the date the camera has been set to is several years back (typically when resetting the camera or batteries have run out).

Now it is by no means easy in SQL, but after several times of leaving through a calender I decided to spend a bit of time to calculate the difference between two dates in days, hours, minutes and seconds. Mainly to use it again after the next holiday or festivity when I have been taking photographs. So finally some Oracle:

SQL> ed
Wrote file afiedt.buf

1 select numtodsinterval(
2 to_date(’02-jul-2007 14:00:00′, ‘dd-mon-yyyy hh24:mi:ss’) –
3 to_date(’08-jan-2004 01:41:00′, ‘dd-mon-yyyy hh24:mi:ss’)
4 , ‘day’)
5* from dual
SQL> /

+000001271 12:18:59.999999999





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: