This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:41gruszczysetrecipients: + gruszczy, sherpya
2011-12-10 22:22:41gruszczysetmessageid: <1323555761.91.0.353555829703.issue13568@psf.upfronthosting.co.za>
2011-12-10 22:22:41gruszczylinkissue13568 messages
2011-12-10 22:22:41gruszczycreate