473,394 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Range of valid years for calendar module?

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
Jul 18 '05 #1
1 2335
[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>.
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dennis M. Marks | last post by:
What is the maximum valid date range for the date(yyyy,mm,dd) function. -- Dennis M. Marks http://www.dcs-chico.com/~denmarks/ Replace domain.invalid with dcsi.net -----= Posted via...
5
by: Dennis M. Marks | last post by:
After reading section 15.9.1.1 the ECMAScript Language Specifications I see that the date range for the Date function is +/- 100,000,000 days from 01 Jan 1970. This is called an extrapolated...
24
by: PromisedOyster | last post by:
Is there a way that I can get a resultset that contains unique dates in a given date range without the need to have a temporary table and a cursor? perhaps something like: declare @start_date...
16
by: DFS | last post by:
If you're listening, I want the middle of the calendar (showing 1 month) to open below the cursor position. It currently opens just to the right and below the cursor position. I hunted through...
5
by: Abdolhosein Vakilzadeh Ebrahimi | last post by:
Is there any way to construct a System.DateTime which doesn't check year, month and day to be in correct range== no validation? Thanks A.V.Ebrahimi
4
by: Todd Perkins | last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually rely on google. So I hope I have enough info contained. Thank you in advance for any help! Problem: I am getting...
5
by: swingingming | last post by:
Hi, When i try to set calendar value, i got such error. the parameters are: (cboDateComponent As ComboBox, ocxCalendar As Calendar) Thank you.
23
by: thebjorn | last post by:
For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that...
19
by: phill86 | last post by:
Hi I am re-posting this thread because it has become very confusing and I have got some way to solving the problem so it is a slightly different question from the initial thread. here is the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.