Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (datetime)
Viewing all articles
Browse latest Browse all 14

Datatime in a Database SQlite ?¿?

$
0
0

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...

Viewing all articles
Browse latest Browse all 14

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>