Range of valid years for calendar module?
tim.peters at gmail.com
Mon Nov 15 17:34:24 CET 2004
> Here's my calendar_for_specified_year.py.
> # calendar_for_specified_year.py
> # print any year's calendar from 1753 A.D. through at least 3999 A.D.
> import calendar
> calendar.setfirstweekday(6) # sets first day of week to Sunday
> year = int(raw_input("Year for which to print calendar: "))
> print "\n\n"
> I've been trying to find out the range of years for which it will give me
> a valid calendar, and I've come up with "from 1753 to at least 3999".
> Does anyone know the actual range for the calendar module?
In modern Pythons, the usable range is inherited from the datetime
module: years 1 through 9999. This is the "proleptic Gregorian"
calendar, which means the current Gregorian calendar indefinitely
extended in both directions (past and future). The idea that this
calendar came into universal use in 1753 is fiction -- for that
matter, so is the idea that this calendar is in univeral use today
More information about the Python-list