Why Is Android System.currenttimemillis() Not An Accurate Timestamp?
I've encountered what appears to be a very unusual bug while developing an android application. The following code in my MainActivity onCreate method: long ts = System.currentTimeM
Solution 1:
While epoch time is measured in seconds, System.currentTimeMillis()
returns the time in milliseconds for more accuracy, which is the value you see in the example. If you divide it by 1000 you will get the time in seconds, which will convert to the current epoch time you expect.
You can paste the value in here to see the timestamp: https://www.epochconverter.com/
Post a Comment for "Why Is Android System.currenttimemillis() Not An Accurate Timestamp?"