Location.getTime() always returns timestamp without milliseconds

前端 未结 1 1726
予麋鹿
予麋鹿 2021-01-05 19:09

I\'m tracking GPS locations with LocationManager.requestLocationUpdates() using LocationManager.GPS_PROVIDER and registering a LocationListen

1条回答
  •  生来不讨喜
    2021-01-05 19:54

    In my experience, System.currentTimeMillis() is a much better way to take timestamps, and it is what I am doing in my app. However, please be advised that, as stated on the android developer site, System.currentTimeMillis() Returns the current time in milliseconds since January 1, 1970 00:00:00.0 UTC so it really depends on what you want to use it for. As I mentioned though, I found it to be more reliable than other forms of timestamps and it is probably best suited for your case.

    0 讨论(0)
提交回复
热议问题