Reg Date string conversion into timestamp function

Peter Hansen peter at engcorp.com
Mon May 16 09:24:37 EDT 2005


praba kar wrote:
>      I have doubt regarding date string to time
> conversion function.  In Python I cannot find flexible
> date string conversion function like php strtotime. I
> try to use following type
> function
> 1) parsedate function failed if a date string
> like below format "16-MAY-2005 01:26"
> 2)parsedate_tz function also failed if a date string
> is different format

Since that's not an RFC2822 date, it shouldn't really be surprising that 
a function that is designed to parse RFC2822 dates would fail to parse 
it properly...

Have you looked at the mxDateTime package's Parser submodule yet?
http://www.egenix.com/files/python/mxDateTime.html#Parser

-Peter



More information about the Python-list mailing list