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.

6 comments on “Date-Ahh

Dude, that’s awesome. Nothing more to say.

Neat! I love these unique and interesting ways to visualize data. It’s pretty awesome that the 80s are variations of blue (my favorite color for a most righteously awesome era).

Marco says:

Awesome! Maybe useless but that doesn’t make it less cool. Really nice idea.

James Miller says:

Dude, sir. Very cool.

Steve says:

Hi – Very cool idea. Now the ? is could we use this to randomly change the color of a web template….so the color of a template represents the day.

I am looking for a design for a new site….how can I connect with you?

Steve

You could use this to randomly change the color of a template, but the difference would be very subtle. A better idea might be to use time rather than date to have a site change throughout the day. Shaun Inman has done some very interesting stuff in the past with changing the design of his site dynamically over time. I’ve thought about playing with that kind of metamorphic design before but never find the time to flesh those ideas out. …which is the reason I’m not currently taking on any freelance projects. 🙂 Feel free to use the contact form to get in touch though.

Leave a Reply to Steve Cancel reply

Your email address will not be published. Required fields are marked *

Back to the top!