Date-Ahh

This is really random, but any date written out in mmddyy format could be used as a unique hexadecimal RGB color code. Today’s date for instance could be represented as #081508. Because of the linear and cyclical nature of time, I thought it would be interesting to see what a series of dates would look like represented by blocks colored with the hex code for each day.

This was surprisingly easy to do in php:

$first_date = "2008-01-01";
$end_date = "2009-12-31";
$alpha = strtotime($first_date);
$omega = strtotime($end_date);
while($alpha <= $omega){
$ufirst = strtotime("+1 day", $alpha);
$formatted = date("m/d/Y", $alpha);
$color = date("mdy", $alpha);
echo '<div class="day" style="background-color:#'.$color.'" title="'.$formatted.'"<&nbsp;</div>';
}

I made a little demo page where you can see what any year (between 1970 and 2037 – the boundaries of php strtotime) looks like. I also made another page the just shows the last 10 years.

Dateahh!

I chose to show 10 years so that I’d get a little bit of the 90s in there, which obviously produce a much brighter blue color. If I were able to render 100 years this way, it would be a very subtle gradient from the dark greens all the way to that bright blue you see at the top. Yea, it’s mostly useless, but I thought it was an interesting way to visualize data.


About this Entry


6 Comments

Sorry, comments are now closed on this post. If you have feedback or need to contact me about something on this page, you can use the contact form.