Filip Gruszczyński <[email protected]> added the comment:
c.execute("insert into testdate values ('now')")
This works, but you actually are putting string "now" into a field with DATE
type. When conversion occurs after retrieving data, there is an error. Also if
you use datetime() function
c.execute("insert into testdate values (datetime())")
you'll get an error later during conversion, because python expects date string
and will get datetime string. This should work for you:
>>> c.execute("insert into testdate values (date())")
>>> x = c.execute("select * from testdate")
>>> for a in x:
... print(a)
...
(datetime.date(2011, 12, 10),)
----------
nosy: +gruszczy
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13568>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com