ran*_*vee 7 timezone datetime android
有没有办法从收到的回调中获取时区
void onLocationChanged(Location location)
Run Code Online (Sandbox Code Playgroud)
使用可从location参数获得的时间信息
long Time = location.getTime();
Run Code Online (Sandbox Code Playgroud)
或者,如果有其他方式,请提供信息!
您可以使用 geonames.org 提供的网络服务。提供纬度和经度以获取时区信息。
http://ws.geonames.org/timezoneJSON?lat=47.01&lng=10.2:
{"time":"2010-07-24 18:35","countryName":"Austria","sunset":"2010-07-24 21:02","rawOffset":1,"dstOffset":2,"countryCode":"AT","gmtOffset":1,"lng":10.2,"sunrise":"2010-07-24 05:48","timezoneId":"Europe/Vienna","lat":47.01}
Run Code Online (Sandbox Code Playgroud)