Android Question Datediff

TheRealMatze

Active Member
Licensed User
Hi,
i have a problem getting a accurate datediff. I need a 1-second-resolution beginning on the 1st of january 2020 00:00:00 UTC. I was thinking the easiest way is using sqlight...
B4X:
Sub timestamp() As Int
    Dim r As ResultSet=sql1.ExecQuery("select (julianday('now') - julianday('2020-01-01 00:00:00')) * 86400 as x")
    r.Position=0
    Return r.GetString("x")
End Sub
On my pc in sqlight cli it works as i expected, in b4a i have only every 100 seconds a change... So it jumps from 61.040.600 to 61.040.700 instead of 61.040.601.

i need a compatible solution for android and ios, has anyone a idea?

Thanks
Matze
 
Last edited:
Top