GPS返回提前一天? [英] gps returns one day ahead?

查看:146
本文介绍了GPS返回提前一天?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid应用程序,我读GPS数据和GPS时间。出于某种原因,GPS返回明天的日期。任何人都知道这是为什么?

In my android app I read GPS data and GPS time. For some reason GPS returns tomorrow's date. Anybody knows why?

我得到的数据是这样的:(它总是好的)。错误在4.0.3?!

I get data like this: (it was always good). Bug in 4.0.3?!

position.GPSTime = new Date(loc.getTime());

修改

我把所有的时间在UTC。在生产这个程序是1年 - 结果我从1小时前展示,你可以看到他们是UTC时间。在左 - 时间从位置服务 - 设备报​​告并在合适的时机。我没有任何混乱,这些日期一般为1-2秒分开。

I keep ALL times in UTC. This app being in production for 1 year - results I'm showing from 1hr ago and you can see they are UTC times. On a left - time reported by device and on a right - time from location service. I'm not confusing anything, those dates usually 1-2 seconds apart.

编辑2

请参阅从我的调试器拍摄从我的手机!用了2分钟前(〜10:10 AM CST)

See shot from my debugger from my phone!! Took 2 minutes ago (~10:10 AM CST)

推荐答案

GPS时间被浪费了前pressed中的协调世界时。基准时间是在伦敦的时间。你感到困惑与您当地的时间,这是在一个时区是比UTC时间1天。

GPS time is being expressed in Coordinated Universal Time. The reference time is the time in London. You're getting confused with your local time which is in a time zone that's behind UTC time by 1 day.

在很多故障排除和研究,我碰到这个code谷歌文章的问题23937:GPS提供商:android.location.Location.getTime()返回在4.0.3 / Nexus S的错误的UTC时间戳记,这似乎说明了同样的症状。

After much troubleshooting and research, I came across this Code Google article Issue 23937: GPS Provider : android.location.Location.getTime() returns wrong UTC timestamp on 4.0.3 / Nexus S which seems to describe the same symptoms.

这篇关于GPS返回提前一天?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆