Converting DD MM YYYY into YYYY-MM-DD?

Gilles Ganault nospam at nospam.com
Mon Aug 17 18:26:47 EDT 2009


Hello,

	I need to convert DD MM YYYY dates into the MySQL-friendly
YYYY-MM-DD, and translate the month name from literal French to its
numeric equivalent (eg. "Janvier" into "01").

Here's an example:

SELECT dateinscription, dateconnexion FROM membres LIMIT 1;
26 Mai 2007|17 Août 2009 - 09h20

I'd like to update the row into "2007-05-26" and "2009-08-17 09:20",
respectively.

What is the best way to do this in Python?

Thank you.



More information about the Python-list mailing list