映射位置的时区 [英] mapping location to a time zone
问题描述
我需要的时区,一个给定的地址/位置。假设地址/位置可以反向地理codeD(使用谷歌)纬度/经度如果必要的。
I need to get the time zone for a given address/location. Assume that the address/location can be reverse geocoded (using google) to a lat/lng if necessary.
这意味着我可能不会有一个zip code。
This means that I may not have a zip code.
我真的很希望,谷歌为此提供了某种形式的API,但似乎他们不这样做。至少你可以谷歌搜索华盛顿时间,并获得时间/ TZ - 但后来我不得不屏幕刮那不是好玩:(
I was really hoping that google provided some kind of API for this, but it seems that they don't. At a minimum you can google search for "time in washington, dc" and get the time/TZ -- but then I'd have to screen scrape that which is not fun :(
我知道有可用的地图位置来时区数据库,但不得不进行维护。有没有人想出了一个棘手的解决这个问题?
I know there are databases available that map locations to time zones, but that'd have to be maintained. Has anyone come up with a tricky solution to this problem?
谢谢!
推荐答案
http://www.geonames.org/ 规定,返回给定纬度/经度
http://www.geonames.org/ provides an API that returns the timezone given a lat/lng
这篇关于映射位置的时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!