MySQLdb and DateTime objects

Nick Arnett narnett at mccmedia.com
Fri Apr 26 18:00:02 EDT 2002


> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Nick Arnett

[snip]

> What seemed to be the obvious solution was to use
> MySQLdb.times.format_TIMESTAMP() or MySQLdb.times.format_DATE()-- but that
> doesn't work, it returns an error:
>
>   File "C:\Python22\Lib\site-packages\MySQLdb\times.py", lin
> STAMP
>     return d.strftime("%Y-%m-%d %H:%M:%S")
> AttributeError: 'tuple' object has no attribute 'strftime'

I was nailed by a typo -- the above actually *does* work, if one is careful
to use the function on the appropriate list member, rather than the entire
list.

But it still seems inelegant...

Nick






More information about the Python-list mailing list