No subject


Sun Nov 12 08:01:13 CET 2006


weekday(year, month, day)  - Returns the day of the week (0 is Monday)
for year (1970-...), month (1-12), day (1-31).

// I figured that was fine, I can avoid using that function in my
wrapper

timegm(tuple) - An unrelated but handy function that takes a time tuple
such as returned by the gmtime() function in the time module, and
returns the corresponding Unix timestamp value, assuming an epoch of
1970, and the POSIX encoding. In fact, time.gmtime() and timegm() are
each others' inverse.

// Okay, I can avoid that too, especially since it is "unrelated"

I probably should have got a clue based on the above, but I didn't....

Well, anyone have a different calendar module that isn't limited like
the Python one that happens to be available?  I would prefer one that
was API compatible.

If not, I'm off to write my own.

--Kaleb

PS: here is the traceback:

>>> import calendar
>>> calendar.monthcalendar(1969,12)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:\progra~1\python22\lib\calendar.py", line 122, in
monthcalendar
    day1, ndays = monthrange(year, month)
  File "c:\progra~1\python22\lib\calendar.py", line 115, in monthrange
    day1 = weekday(year, month, 1)
  File "c:\progra~1\python22\lib\calendar.py", line 106, in weekday
    secs = mktime((year, month, day, 0, 0, 0, 0, 0, 0))
OverflowError: mktime argument out of range

The error is identical under Linux





More information about the Python-list mailing list