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, so I did not use anything from this source.
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.
However if you just want a single quick calendar conversion, there is a handy web-based interface to the Calendrical Calculations available.
Lance Latham's Standard C Date/Time Library
Another commonly cited reference 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.
The algorithms in Ahlquist's code are similar to those used in the udunits library, which references a Fortran90 nagware implementation. I did not use the nagware code or algorithms to avoid any possibility of falling under NAG's software license.