I have the same issue: http://groups.google.com/group/web2py/browse_thread/thread/9c7b2293d07bd11e
So, how should datetime be stored then? In my case, a non-w2p process is creating the records. Visually, checking the database, both strings appear the same. On May 27, 11:05 am, mdipierro <[email protected]> wrote: > sqlite is does not enforce field types (web2py does). You are storing > a string in place of date. > > On May 26, 8:48 pm, liugehao <[email protected]> wrote: > > > thanks > > > model: > > > import datetime > > now=datetime.datetime.now() > > > db.define_table('entry',SQLField('category','integer'), > > SQLField('title','string',length=50), > > SQLField('content','text'), > > SQLField('tag','string',length=150), > > SQLField('inputtime','datetime',default=now), > > SQLField('pubed','integer',default=0) > > > ) > > > the field 'inputtime' type is 'timestamp' > > > >>import sqlite3 > > >>conn=sqlite3.connect('/home/liugehao/web2py/applications/databases/storage.db') > > >>cur=conn.cursor() > > >>cur.execute("insert into entry (title,content,inputtime) values > > >>(?,?,?)",['title','content','2009-1-1 1:12:22']) > > > the data fixed,but why it use split ? > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

