Message149194
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),) |
|
Date |
User |
Action |
Args |
2011-12-10 22:22:41 | gruszczy | set | recipients:
+ gruszczy, sherpya |
2011-12-10 22:22:41 | gruszczy | set | messageid: <1323555761.91.0.353555829703.issue13568@psf.upfronthosting.co.za> |
2011-12-10 22:22:41 | gruszczy | link | issue13568 messages |
2011-12-10 22:22:41 | gruszczy | create | |
|