Range of valid years for calendar module?

J

Jack Crane

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"
calendar.prcal(year)
===============================================

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". I
used <http://www.timeanddate.com/calendar/index.html?year=4000&country=1>
which seems to give calendars for years 1-3999.

Does anyone know the actual range for the calendar module?

Thanks,

Jack
 
T

Tim Peters

[Jack Crane]
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"
calendar.prcal(year)
===============================================

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
<wink>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top