[Python-Dev] Re: datetime issues

Gustavo Niemeyer niemeyer at conectiva.com
Mon Sep 15 12:50:26 EDT 2003

> >If Guido wanted to stay out of the relatively clear <snort> time zone
> >business, I can imagine his interest in trying to guess how to parse date
> >and time strings.  Apart from Brett's strptime(), I believe the email 
> >module
> >has some useful string->datetime code.
> The PyXML package includes a parser (xml.utils.iso8601) for the date/time 
> format most commonly used in XML applications.  That and a parser for 

Cool! Thanks for mentioning it!

> RFC822 dates would meet the needs of many technical applications (though 
> not ones where users can enter dates -- but that problem may be too 
> complicated for the stdlib). 

I do not agree. I've done a small research and there seems to be many
nice generic implementations of these parsers, which would benefit
technical applications *and* hand made dates (some of them below[1]),
and it doesn't look that complex. I'll be working to provide trial
implementation collecting the best features described in these papers in
the near future.

Btw, the relativedelta is mostly ready. That's the first step to provide
relative dates in the parser.

> I'll happily convert the iso8601 module for addition to the standard
> library if date parsing is deemed a topic of interest.

I'm not yet sure if date parsing and other improvements in the date/time
area is a topic of general interest, but at least I am interested. :-)


Gustavo Niemeyer

More information about the Python-Dev mailing list