我可以从 IP 地址确定区域信息吗?
无论如何,我是否可以计算出估计的 (Olson) ZoneInfo 值(例如(“美国/Los Angeles”、“Europe/London”等),对于 .NET 中的单个公共 IP 地址...?
我已经有了 ZoneInfo 值的完整列表,所以这不是问题...并且很快就可以了我只想根据 IP 默认选择一个值,
我知道 IP 不会 100% 准确,而且代理可能会破坏某些内容……但这可能是为了获得一个粗略值
?
吗 认为可以将 ZoneInfo 值与 GMT 时区关联起来..也许?
是的..请为 .NET
干杯
(感谢 OpenID 使用 ZoneInfo 而不是 GMT 时区 :( )
更新
我发现了 此页面描述了区域和纬度/经度之间的关系。因此是否可能(例如,任何人都想建议一些代码示例?)如何使用经纬度确定正确的区域信息?
is there anyway I could figure out an estimated (Olson) ZoneInfo value (eg. ("America/Los Angeles", "Europe/London", etc.), for a single public IP address ... in .NET?
I already have a full list of ZoneInfo values, so that's not a problem ... and in a drop down box. I just want to default a selected value based on an IP.
I understand the IP won't be 100% accurate and proxies could frak things ... but this is to get a rough value.
Is this possible?
I was thinking it might be possible to associate a ZoneInfo value to a GMT timezone .. maybe?
And yeah .. for .NET please.
cheers!
(thanks OpenID for using ZoneInfo instead of GMT timezones :( )
Update
I found this page which describes the relationship between a Zone and Lat/Long. Is it therefore possible (eg. anyone want to suggest some code examples?) how, using a Lat Long, determine the correct ZoneInfo?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是所谓的地理定位,它们有多种产品。 大多数情况下,这是一项付费服务。
您可以尝试这个一个...它是免费的。 :)
That is call Geolocalization and they are several products around. Mostly this is a paid service.
You can try this one... its free. :)
我创建了自己的服务,通过 IP 向我提供 ISP 和国家/地区,
您可以在这里尝试
如果您想要的话,我可以分享代码。
新答案
为什么您需要 IP 地址的时区? 为什么需要 IP 地址?
您可以轻松地从客户端获取 OffSet 时间。
我刚刚实现了代码,它输出了正确的 GMT 时区。
I created my own service to give me the ISP and Country from an IP
you can try it here
I can share the code, if this is what you want.
New answer
Why do you want the TimeZone from an IP Address? Why do you need the IP Address for?
You can easyly get the OffSet time from the client.
I just implemented the code and it outputs the correct GMT timezone.