SQLite datetime problem

hung

Active Member
Licensed User
Longtime User
I used the following script to update a table

SQL1.ExecNonQuery ("insert into scanlist values('"& lastscan &"', datetime())")

althrough the phone's timezone is set to my timezone +8, the record still keeps the gmt time.:sign0085:

Is there any way i can update table with my device's system time?
 

hung

Active Member
Licensed User
Longtime User
I just upgraded my Huawei Honor to android 4.0.3. Not sure if that cause the probelm.
 
Upvote 0

hung

Active Member
Licensed User
Longtime User
You can use DateTime.Now instead of the sql command.

That is right. DateTime.Now as client time works.

I was thinking that SQLite is running in the devices so the SQLite time should be same as client (the device) but seems not.:eek:
 
Upvote 0

hung

Active Member
Licensed User
Longtime User
This is the one run successfully at last:

SQL1.ExecNonQuery ("insert into scanlist values('"& lastscan &"', '"& DateTime.Date(DateTime.Now) & " " & DateTime.time(DateTime.Now) &"')")
 
Upvote 0
Top