Why reinvent the wheel?
I wanted calendar software that:
Unfortunately I could not find such a package. Read on for specific comments on what's out there.
Dershowitz and Reingold's Calendrical Calculations
This is a book and associated software covering all sorts of calendar calculations. Unfortunately it seems to include a very restrictive license.
One of the authors of Calendrical Calculations, Edward M. Reingold, is also an author of the GNU Emacs calendar code. That code is released under GPL, but it's written in LISP, which was not directly useful for me.
Reingold also has a C++ version of some of the basic calendar calculations available at his web site. This C++ code is in the public domain. I used a couple of algorithms from this public domain code. However, most of the coding effort in CalCalcs involved handling the way our calendar transitioned from the Julian calendar to the Gregorian calendar. Reingold's public domain C++ code did not address this issue, and so was of limited use to me.
There is a web-based interface to the Calendrical Calculations available, which might be useful to you.
Lance Latham's Standard C Date/Time Library
Another commonly cited refernce is Lance Latham's Standard C Date/Time Library (SCDTL). Here is what the license for these routines says:
Jon Ahlquist's calndr.f routine
Jon Ahlquist of Florida State University has a nice web site with calendar information available, along with a GPL'd calendar routine written in Fortran. This is quite useful if you have Fortran, but that has become rather uncommon nowadays.