ODBC and Access Short time format
news.terra.es
alvmart at terra.es
Sun Oct 12 13:58:50 EDT 2003
Hi all,
I cannot manage an Access short time date format from python ODBC.
How could I do?
Here it is an example of what I do.
>>> import odbc
>>> cnn = odbc.odbc("DATETEST")
>>> cur = cnn.cursor()
>>> cur.execute('select * from fechas')
0
>>> print cur.description
[('fLongDate', 'DATE', 19, 19, 0, 0, 1), ('fShortTime', 'DATE', 19, 19, 0,
0, 1)]
>>> print time.strftime("%d-%m-%Y %H:%M",time.localtime(rec[0].value))
31-12-2001 20:30
>>> print time.strftime("%H:%M",time.localtime(rec[1].value))
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
IOError: [Errno 22] Invalid argument
Regards
More information about the Python-list
mailing list