I have a database with a datetime field, how I can change the date to the current date time keeping?
thanks
Printable View
I have a database with a datetime field, how I can change the date to the current date time keeping?
thanks
Use QTime.
Extract time from the system and update it in the database.
I have a table with a datetime field you can change all values ​​in the field of time keeping and changed the part of date.
The field looks like this:
2012-08-07T11: 38:00
You can change the 08/07/2012 holding T11: 38:00 intact.
How you do this will depend on the database date functions and the exact type of the "date time" column. Which database engine?
use QSQLITE
Code:
db.setDatabaseName(Path + "/Eventos/evento.evt"); db.open(); query.exec("UPDATE HORAS SET HORA = DATE_ADD(HORA, INTERVAL 1 DAY) WHERE rowid > 0"); // error
hey you're writing the wrong SQL Statements. Set all the value of Date in the variables and update it here. How SQLite will know that you're using the date_add function.