At start you have a string 'DDMMYYYY HHMMSS' and I want at the end to insert the string in a date field in sqlite3 database. The program is made in python. How can I do that ?
+1
A:
Even though the ".schema" indicates that the field is a date or timestamp field... the field is actually a string. You can format the string anyway you want. If memory serves... their is no validation at all.
Richard
2009-05-20 20:20:00
+1
A:
I believe sqlite3 doesn't have a DATE type, therefore you have to do it manually in your python code. Either you store the date in exactly this form or you convert it into a timestamp or some other form.
Have a look at the datetime module and especially at the strptime
function.
Georg
2009-05-20 20:21:04