473,555 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Range of valid years for calendar module?

Here's my calendar_for_sp ecified_year.py .

=============== =============== =============== =
# calendar_for_sp ecified_year.py
# print any year's calendar from 1753 A.D. through at least 3999 A.D.

import calendar

calendar.setfir stweekday(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 2343
[Jack Crane]
Here's my calendar_for_sp ecified_year.py .

=============== =============== =============== =
# calendar_for_sp ecified_year.py
# print any year's calendar from 1753 A.D. through at least 3999 A.D.

import calendar

calendar.setfir stweekday(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
3011
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 Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
5
2414
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 Gregorian calendar. Since the Gregorian calendar did not begin until 15 Oct 1582 what is the purpose of dates before that date? Wouldn't any computation...
24
4402
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 as datetime declare @end_date as datetime set @start_date as '1/1/2005' set @end_date as '1/1/2006'
16
3040
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 the code, but can't determine what to alter. Very nice piece of work, by the way. Thanks
5
3932
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
16965
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 this error when I try to pull up my edit page to display the current database information in the form, and then edit it on click:
5
5734
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
14009
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 didn't work (the timedelta class doesn't have a year accessor). I looked in the docs and the cookbook, but I couldn't find anything, so
19
6002
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 original tread http://bytes.com/topic/access/answers/872005-query-date-range Just to clarify what I am trying to achieve....
0
7621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7542
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7824
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8060
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5452
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5170
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1156
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.