Message149194
| Author |
gruszczy |
| Recipients |
gruszczy, sherpya |
| Date |
2011年12月10日.22:22:41 |
| SpamBayes Score |
5.3319516e-05 |
| Marked as misclassified |
No |
| Message-id |
<1323555761.91.0.353555829703.issue13568@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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),) |
|
History
|
|---|
| 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 |
|