Enter any year after 1582 (the start of the modern calendar), choose a month, then click 'New Calendar' to show the calendar for that month. (The Perpetual Calendar requires a Java-Compatible browser. If you don't see it, try this non-Java Calendar instead.)
This clever calendar was written by Michael Bertrand; you can get the source code for it at his home page. Here are some relevant facts from his page:
"Pope Gregory XIII established the modern calendar in 1582 by removing three leap years from every 400 year cycle, compared to the old Julian calendar which provided for a leap year every fourth year without exception. The excluded leap years were those a multiple of 100 but not of 400; so 1700, 1800, and 1900 were no longer leap years under the Gregorian calendar, but the year 2000, a multiple of 400, is still a leap year."
"Normally the calendar advances one day each year because a year is 52 weeks and one day. Leap years, however, are 52 weeks and two days, so the calendar advances by two days following a leap year. CALENDAR calculates how many normal years and how many leap years have elapsed between 1582 and the given year, then calculates the day of the week for January 1 of the given year by comparing with 1582. Calculating the day of the week for the given month is then a simple matter, and the calendar can be drawn."
For more calendar info, see the "Genealogy Calendar" section of the links page.