Changing Locale for datetime.strptime conversions

Antoine Pitrou solipsis at pitrou.net
Tue Jul 6 12:03:22 EDT 2010


On Tue, 06 Jul 2010 11:54:46 -0400
python at bdurham.com wrote:
> Antoine,
> 
> > If you want to do this seriously, I suggest you instead take a look at third-party libraries such as Babel: http://babel.edgewall.org/
> 
> Not the OP, but has Babel implemented parsing support? Last time I
> looked, Babel did a great job with locale specific formatting, but
> locale specific formatting was still incomplete.

No idea, but if you just want to recognize month names, you can produce
all the month names in the desired natural language and then recognize
them yourself (using e.g. a regexp). Probably imperfect, but probably
sufficient in many cases too.




More information about the Python-list mailing list