Visualize History

How it all went down.

Historical Dates and Date Comparison

Dates present a complex problem for an application like Visualize History.  I did not expect them to be this complicated, and now find myself struggling to implement historical dates as they should be.

The problem arises because of the way computers think of dates.  To a computer, a date is an exact moment, for instance, 4:22 PM EST on Sunday, April 20.  4:22 EST is not the same as 4:23 EST, nor is it the same as April 20th.

Humans almost never use dates in this way.  When I say "what are you doing for July 4th?" I don’t mean to ask what are you doing on July 4th at midnight, but rather, the entire day.  Similarly, when I say the Great Depression happened in the 30s, I don’t mean any specific moment during the 30s but rather all 10 years.

The problem manifests itself most obviously when dates are being compared.  Imagine a Visualize History session in which you are examining the signing of the Declaration of Independence.  The date for that event, as we all know, is July 4, 1776.  The computer stores this date as midnight on the 4th.  So, following the computer’s way of storing dates, the session might show the signing of the declaration, which it thinks happened at midnight, as happening before John Hancock placed his John Hancock on the bottom of the declaration.  Of course no reasonable person would even follow that, much less believe it.

The first solution that comes to mind is, presumably, to specify the date of the Declaration more precisely, perhaps including the exact time of signing.  There are two problems with this solution.  The first is practical, namely that data is rarely saved so precisely.  Mostly people know the day when the Declaration was signed, but people rarely know the time, especially not down to seconds.  Secondly, many events are not precise.  The Great Depression can be said to have ended at an exact moment, including times, yet we can be fairly certain that some events happened during the Depression and some did not.

The next solution that should come to mind is store historical events as having a start and an end, so that when deciding whether an event happened during the depression, you could ask whether it happened before the end of the depression.  This solution is the correct one, in abstract terms; it represents the way humans use dates to discuss history.  Unfortunately, it does not lend to an easy or efficient implementation.  Most computer languages have built in Date libraries, but none that I know of treat Dates in this way.

My proposed solution is in part based off MySQL and in based of KML files from Google, which both specify a precision along with their dates.  For example, I might say that a date is July 4th, 1776, and that for comparison purposes, the year, month and day (but not hour, minute, or second) are significant.  Comparing such a Date object would take some mildly complex logic, but with some thought could be made to work as humans think of dates.

If you are not convinced, take an extreme example.  If you study evolution (or biblical history, if you prefer), you often encounter dates like 10,000 BC.  It is implied that 10,000 BC is not distinct from 10,001 BC or 9,999 BC but is to be compared with 1,000 BC or 100 BC.  So 5,000 years is the difference between dates that interests us.  Yet now, we the difference between September 10, 2001 and September 12, 2001 as incomprehensibly large.  So it’s all relative, I suppose.

JavaScript limits the process even more, since it stores dates as the number of seconds since the Epoch, January 1, 1970.  That makes storing dates earlier than about 1900 fairly difficult and dates earlier than 1000 AD cannot be stored at all.  A lot of interesting history happened before 1000 AD, so a different system needs to be used.

I’m not sure that I have time to implement this date scheme as I hope to, but I wanted to write it out to illuminate the issue.

2 comments

2 Comments so far

  1. Weight Loss Ingredients December 15th, 2010 1:50 pm

    Howdy, it can be that may be off of area rather ok, enough fooling, i have been previously shopping around in existence the sites that’s why it turns out in actual fact relatively b. I happen to be building a additional internet page but having trouble keeping up to really make it look nice, whenever method little things my spouse and i spoil it. What solid was indeed the application to start web site? Have the ability to a guy just like me with out endure get it done, additionally add in the wife and children replace blog pages without the need destroying the idea training routine?

  2. Mirror Tiles January 23rd, 2011 10:22 am

    I am very thankful to this topic because it really gives useful information :*”

Leave a reply