Site hosted by Angelfire.com: Build your free website today!

Year Correlation Algorithm

I was assigned a web calendar project that is like any other calendar project out there. It needed to provide all sorts of calendar views, such as displaying information for a given day, week, or month. It also had to keep track of various types of event and profile information relevant to the user. (Unfortunately, after I wrote up all of the function libraries, the project was scapped by higher powers that be.)

Before the termination of the project, I came across the issue of determining certain date computations. This may seem trivial, especially when I wrote the project using Visual Basic, which has its own set of date functions. But I needed to find some sort of way to generate certain aspects of the calendar using an existing set of static month images. That's how I stumbled upon the following URL:

Virtual Perpetual Calendars:
http://www.vpcalendar.net/Year_Correlations.html
http://www.mnsinc.com/utopia/Calendar/Year_Correlations.html (old link)

The page displays tables which show how 14 different year calendars (numbered 0 though 13) are cycled through each century. It didn't exactly tell me an algorithm which I could go by, but it was enough for me to figure it out.

If you wish, you can test the algorithm.