timestamp now with sqlite
in
Contributed Library Questions
•
1 year ago
Hi, I have tried many ways to insert the timestamp now in a query with sqlite but without succeed. For example:
db.execute( " INSERT INTO rilevazioni (ID, data, valore) VALUES ('2', "'getdate()", "value") " );
or
Date d = new Date();
long current = d.getTime()/1000;
db.execute( " INSERT INTO rilevazioni (ID, data, valore) VALUES ('2', "+current+", "value") " );
but the program doesn't work :-(
Do you know how to insert the current timestamp? Thanks
db.execute( " INSERT INTO rilevazioni (ID, data, valore) VALUES ('2', "'getdate()", "value") " );
or
Date d = new Date();
long current = d.getTime()/1000;
db.execute( " INSERT INTO rilevazioni (ID, data, valore) VALUES ('2', "+current+", "value") " );
but the program doesn't work :-(
Do you know how to insert the current timestamp? Thanks
1