In appcelerator Titanium Studio:
well, I am trying to add Datatime (now) in the database (name: todo)
CREATE TABLE "todo" ("item" TEXT DEFAULT (null) ,"done" INTEGER DEFAULT (null) ,"title" TEXT,"fecha" DATETIME DEFAULT (CURRENT_TIMESTAMP) )but i cant
my database's column is "fecha" and its the 4 column so:
exports.addItem = function(_title, _item, _fecha) { var mydb = Ti.Database.open(DATABASE_NAME); mydb.execute('insert into todo values (?,?,?,?)', _item, 0, _title, _fecha); mydb.close(); };ok, This code is perfect, but, now how I write in this database the actual datetime pushing a button ?? I think I need a new function and a new variable but i dont know...