Hi,
I cannot save the current date and time to a SQLite table:
The log says:
locationchanged: 1643644701339
locationchanged: 1643644702343
** Activity (main) Pause, UserClosed = false **
** Activity (tabelle) Create, isFirst = false **
Table: -1327782010
Table: -1327793008
Table: -1327804006
I cannot save the current date and time to a SQLite table:
B4X:
Private t As String
t = "CREATE TABLE if not exists locations (ID INTEGER PRIMARY KEY, zeit integer, lati real, longi real, " & _
"alti real, speed real, dist real)"
sql1.ExecNonQuery (t)
...
Private dt As Long
dt=DateTime.now
Log ("locationchanged: " & dt)
sql1.ExecNonQuery ("insert into locations values (NULL, " & dt & "," & Location1.Latitude & "," & Location1.Longitude & "," & Location1.Altitude & "," & Location1.speed & ",0)")
...
' then I want the "zeit" value from the sql-table:
t = "select * from locations order by ID desc limit 1000"
Private rs As ResultSet
Private z As Long
rs = Tracker.sql1.ExecQuery (t)
Do While rs.NextRow
' tim=rs.getstring ("dt")
z=rs.GetInt ("zeit")
Log ("Table: " & z)
The log says:
locationchanged: 1643644701339
locationchanged: 1643644702343
** Activity (main) Pause, UserClosed = false **
** Activity (tabelle) Create, isFirst = false **
Table: -1327782010
Table: -1327793008
Table: -1327804006