Is the 'now' command working in the sqlite mod? According to the docs here: http://www.sqlite.org/lang_datefunc.html i should be able to use this command to get the current date and time, only it seems to be returning 0.
I've posted the offending code below (pulled straight out of various different places in my project), maybe i am doing something wrong, but i've checked and checked...
if it isn't working, is there a module that can get the current date and time?
Cheers
Charlie
I've posted the offending code below (pulled straight out of various different places in my project), maybe i am doing something wrong, but i've checked and checked...
Local s3:String = "CREATE TABLE scores (id integer primary key AUTOINCREMENT," + .. " playerID integer NOT NULL, " + .. " score long," + .. " level integer," + .. " scoreDate datetime," + .. " FOREIGN KEY (playerID) REFERENCES userProfiles(id))" ' sys_Database.executeQuery(s3) If sys_Database.hasError() Then DebugLog("Failed to create scores table") ; DebugLog("Terminating Program") errorAndClose(sys_Database) End If Local query3:TDatabaseQuery = TDatabaseQuery.Create(sys_Database) query3.prepare("INSERT INTO scores values(null,1,3456789,3,'now')") query3.execute() Local query3:TDatabaseQuery = TDatabaseQuery.Create(sys_Database) query3 = sys_Database.executeQuery("SELECT * from scores") While query3.nextRow() Local record:TQueryRecord = query3.rowRecord() DebugLog("scoreID: " + record.value(0).getInt()) DebugLog("playerID: " + record.value(1).getInt()) DebugLog("score: " + record.value(2).getLong()) DebugLog("level: " + record.value(3).getInt()) DebugLog("date/time: " + record.value(4).getDate()) Wend
if it isn't working, is there a module that can get the current date and time?
Cheers
Charlie