从纬度和经度获取的Windows的TimeZoneInfo [英] Get Windows TimeZoneInfo from Latitude and Longitude

查看:366
本文介绍了从纬度和经度获取的Windows的TimeZoneInfo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个web应用程序我人进入他们的地址,然后我使用谷歌的地理code API ,以得到他们的经度和纬度。接下来,我想获得他们的 Windows时区名称使用这些坐标,这样我就可以对付的夏令时通过净正确的TimeZoneInfo 对象。

In a web app I have people enter their address, then I use Google's geocode API to get their latitude and longitude. Next, I would like to get their Windows time zone name using these coordinates so I can deal with Daylight Savings Time correctly via the .Net TimeZoneInfo object.

我打了几个可用的时区的Web服务即可得到时区名称,例如:

I played with several of the available time zone web services to get the time zone name such as:

  • http://www.askgeo.com/
  • http://www.geonames.org/
  • http://www.earthtools.org/

问题是,这些都返回要么只是从格林尼治标准​​时间,或TZID(又名奥尔森)时区名称,偏移的不是Windows时区名称的。

The issue is that these all return either just the offset from GMT, or the TZID (a.k.a. Olson) time zone name, not the Windows Time Zone name.

目前在这个下面的链接的列表是转换从Windows到TZID的名字,但不是因为很多的TZID名字相反的方向缺失。例如,如果TZID我从第一步得到的是非洲/卢萨卡,那么该表将不会找到一个等效的Windows时区名称。

There is a listing at this following link that translates from Windows to TZID names, but not in the opposite direction since many of the TZID names are missing. For example, if the TZID I get from the first step is "Africa/Lusaka" then the table won't find an equivalent Windows Time Zone Name.

  • 窗口 - > TZID: <一个href="http://uni$c$c.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html">http://uni$c$c.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html
  • TZID - >窗口: ???
  • Windows -> TZID: http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html
  • TZID -> Windows: ???

我的问题是, 没有人知道,可以通过返回Windows时区名称服务的纬度/经度或如果有一个完整列表或翻译服务两个命名格式之间进行转换?

So my question is, does anyone know of a service that can return a Windows Time Zone Name via lat/lon or if there is a complete listing or translation service to convert between the two naming formats?

注意:我已查看了所有类似的问题在这里,但都没有彻底解决这个问题。

Note: I have reviewed all the similar questions here, but none have completely solved this issue.

推荐答案

刚刚发现这个网络可能是一个解决办法。将进一步调查:

Just found this online which may be a solution. Will investigate further:

http://www.timdavis.com.au/data/olson-time-zone-database-to-standard-windows-time-zone-v01/

这篇关于从纬度和经度获取的Windows的TimeZoneInfo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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