Just like when you commit the log, the system will record the time of the commit, if you want to insert data in the table created under Sqlite3, the time point of inserting data is stored in the SQLite database how to deal with it?
Create a database, such as Foo.db
Create a table in this list:
CREATE TABLE time ([ID] INTEGER PRIMARY Key,[idcardno] VARCHAR ([createdtime] TimeStamp not NULL DEFAULT current_timest AMP);
Insert data:
INSERT into time ([Idcardno]) VALUES (' AAA ');
View:
SELECT * from time;
The result is
1|aaa|2011-10-6 06:48:51
This time will find that this is not the time of the system, and the world time, how to deal with it?
CREATE TABLE time ([ID] INTEGER PRIMARY Key,[idcardno] VARCHAR ([createdtime] TimeStamp not NULL DEFAULT ("Now ', ' localtime '));
Insert Data again
INSERT into time ([Idcardno]) VALUES (' AAA ');
View:
1|aaa|2011-10-6 13:05:51
This corresponds to the local time of the system.
SQLite inserts the current date time