Android Question Inserting datetime in sqlite db

ThePuiu

Active Member
Licensed User
I'm trying to save some information in the application's database. The table has 3 fields: id (int, unique, not null), content (text) and moment (real). The code used is:
B4X:
mySQL.BeginTransaction
    Try   
        Dim Acum As Long = DateTime.Now           
        
        Dim synt As String ="INSERT Or IGNORE INTO Dashboard (id, content, moment) VALUES (1, ?, ?);    UPDATE Dashboard SET content = ?, moment = ? WHERE id = 1"
        
        mySQL.ExecNonQuery2(synt, Array As Object( content, Acum))
        mySQL.TransactionSuccessful
    Catch
        Log(LastException)
    End Try
    mySQL.EndTransaction
    mySQL.Close

The write operation does not return any errors but the information written in the MOMENT field is always date= today and time = 20:20:00 . The information written in the CONTENT field is correct.
What is wrong?
 
Top