如何获得当前时间任何地点 [英] How to get the current time in any location

查看:126
本文介绍了如何获得当前时间任何地点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要上传的图片,并与我有当图像被上载,我正在从它被上传设备的经纬度发送日期和时间,现在我想的时间,在该时间点该位置的日期时​​,图像上载。 我不想接受来自设备的日期和时间,是否有可能得到的日期和时间随纬度的地方和经度的帮助。

I have to upload an image and with that i have to send the date and time when the image is uploaded, I am getting the latitude and longitude of the device from which it is uploaded, now i want to get the time and date of that location at that point of time when the image is uploaded. I do not want to take the date and time from device, Is it possible to get the date and time with the help of latitude and longitude of that place.

推荐答案

您可以获取时区和当前时间的纬度,从长期通过Web服务GeoNames的的 http://www.geonames.org/export/web-services.html#timezone

You can get the time zone and the current local time for a lat long from webservice by GeoNames http://www.geonames.org/export/web-services.html#timezone.

演示链接 HTTP://api.geonames。组织/ timezoneJSON纬度= 47.01和放大器; LNG = 10.2和放大器;用户名=演示

输出格式

{"time":"2011-12-28 08:03",
 "countryName":"Austria",
 "sunset":"2011-12-28 16:36",
 "rawOffset":1,
 "dstOffset":2,
 "countryCode":"AT",
 "gmtOffset":1,
 "lng":10.2,
 "sunrise":"2011-12-28 08:04",
 "timezoneId":"Europe/Vienna",
 "lat":47.01
}

在这里注册用户名 http://www.geonames.org/login

Register for a username here http://www.geonames.org/login

这篇关于如何获得当前时间任何地点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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