Bug? Return millisecond error

cxbs

Active Member
Licensed User
Longtime User
hello everyone!
I found a strange error when converting timestamps,
I don't know what caused it
How to avoid this mistake
Thank you!
The above English is from translation software

timer.jpg


B4X:
DateTime.DateFormat="yyyy-MM-dd"
 DateTime.TimeFormat="HH:mm:ss.SSS"
    Dim t As Long=DateTime.DateTimeParse("1970-01-01","15:16:17.191")
    Log(t) '=83777190
    Log(DateTime.Time(t)) '=15:16:17.190

    Dim t As Long=DateTime.DateTimeParse("1970-01-01","15:16:17.192")
    Log(t) '=83777192
    Log(DateTime.Time(t)) '=15:16:17.192
 

cxbs

Active Member
Licensed User
Longtime User
In iOS, date is stored with double type representing seconds. You are hitting the accuracy limit.
Dear Mr. Erel
Thank you for your reply. I will verify it after each conversion.
 
Top