如何在PHP中通过IP地址获取时区 [英] How to get Time Zone through IP Address in PHP

查看:373
本文介绍了如何在PHP中通过IP地址获取时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望通过PHP中的IP地址获取时区。实际上,我有一个将在客户机上运行的应用程序。我有客户机的IP地址。但是我无法为每台客户机获得时区。

I want to get time zone through an IP Address in PHP. Actually, I have an application which will run at the client machine. I have the IP address of the client machine. But I am not able to get the time zone for each client machine.

推荐答案

获得卡车车队自行车和驾驶世界各地记录每个人的无线路由器的IP地址和当前的GPS坐标。

Get a fleet of trucks bicycles and drive around the world logging everyone's wireless router's ip address and the current GPS co-ordinate.

这就是谷歌所做的。我是认真的。

That's what Google did. I am not kidding.

更新:如果你买不起,请使用 MaxMind GeoLite2 ,它按IP地址告诉您时区。它有一个本地PHP API(数据库阅读器)。

Update: If you can't afford that, use MaxMind GeoLite2, which tells you the timezone by IP address. It has a local PHP API (the "database reader").

这篇关于如何在PHP中通过IP地址获取时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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