How to store current date and time in Sqlite using PhoneGap?
tx.executeSql("CREATE TABLE IF NOT EXISTS myorder(orderid INTEGER PRIMARY KEY AUTOINCREMENT,cdatetime VARCHAR)");
tx.executeSql('INSERT INTO myorder(orderid,cdatetime) VALUES(NULL,"01/01/2012 01:00:00")',[],successOrderfunction,errorfunction);
Is it correct way to store?
You can save the current datetime as long.
Define your table column with the long-datatype and insert your value like this:
By the way. There is no need to use autoincrement. If you try to insert a null value in a primary key integer the field is automatically converted into an integer which is one greater than the largest value of that column.