Converting DD MM YYYY into YYYY-MM-DD?

Jonathan Gardner jgardner at jonathangardner.net
Mon Aug 17 19:55:49 EDT 2009


On Aug 17, 3:26 pm, Gilles Ganault <nos... at nospam.com> wrote:
> 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