calendar lameness!

Andreas Kostyrka andreas at kostyrka.priv.at
Fri Jul 26 16:51:19 EDT 2002


Am Mon, 2002-07-22 um 15.35 schrieb Terry Hancock:
> "calendar" is pretty neat -- except it has pretty
> annoying arbitrary limits on the date:
> 
> 1900-1/1 to 2038-1/18
Well, this is not that arbitrary. Considering the fact that the
"calendar" wasn't standardized completly the beginning of the 20th
century. So anything that goes that far back would have to specify the
country (or even the substate in the country) to be precise. And that
doesn't even take into account that the French Revolution tried to do
away with the 7-days week, ...

> I can see that this is adequate for a business
> planner, but for historical or astronomical uses,
> it's really inadequate.  (e.g. "What day of the
> week was the US Declaration of Independence signed
> on?"  I'm sure I could look that up, but gee it
> would've been nice to just type:
> 
> calendar.weekday(1776, 7, 4)
calendar.weekday(1776,7,4,"USA")

> Actually, it looks like maybe it's "mktime" that
> is the limiter here (?).  How hard would it be to
> replace that call with something smarter?  It seems
> like Python longs would make it unnecessary to
> have such arbitrary limits.
Well, it's not that much a limit of calculating power, it's more that
the subject of calendars is difficult. By using the underlying C library
implementation the Python implementers don't have to think about these
political and religious considerations. ;)

Andreas





More information about the Python-list mailing list