"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Actually, MySQLdb isn't released for Python 2.5 yet, so for > anything with a database, you need an older version of Python.
It's not really a problem so far. > If you really want to change the conversions for TIMESTAMP, add the > "conv" argument to "connect". Make a copy of > "MySQLdb.converters.conversions", > then replace the key "MySQLdb.FIELD_TYPE.TIMESTAMP", which normally has > the value 'mysql_timestamp_converter' with your own converter. You can > then get the interface to emit a "datetime" object. Thanks! Very helpful. Actually, it's DATETIME I want and not TIMESTAMP, but you certainly pointed me in the right direction. Turns out the author of MySQLdb knows his onions, and virtually all of what I need is in there. Seems it's critical to send in the right Python type to trigger the right conversion routine to get the right result, and some of the choices are not completely obvious. Still, the concept is good. > None of this will help performance; dates and times are sent over the > connection to a MySQL database as strings. Whenever you touch SQL (a) you talk strings and (b) performance belongs on a different planet. I can live with that. DY -- http://mail.python.org/mailman/listinfo/python-list