Date validation

Asun Friere afriere at yahoo.co.uk
Mon Apr 28 00:54:12 EDT 2003


"Fredrik Lundh" <fredrik at pythonware.com> wrote in message news:<mailman.1051257039.22404.python-list at python.org>...
> if you want your program to check how many days there are in
> a given month, use the calendar module:
> 
> >>> import calendar
> >>> firstday, ndays = calendar.monthrange(2003, 4)
> >>> print ndays
>  30
> >>> print calendar.day_abbr[firstday]
> 'Tue'
> 
> </F>
Unfortunately calendar.monthrange does not work for years < 1970 in
the latest stable release, as I just discovered :(   (To be more
preceise, it doesn't seem to work for any year in the from the 2nd
Century till 1970, but it does work for all but the last year of the
1st century).  I see this has been fixed in 2.3a2.

While checking this out, I noticed that calender.py in 2.3a2 imports
'datetime,'
for which there is no python file.  Is this now the wrapper to the
various clib implementations?




More information about the Python-list mailing list