这是从http://smart-ip.net/geoip-json/178.44.164.112
返回:
{"source":"smart-ip.net","host":"178.44.164.112","lang":"en","countryName":"Russia","countryCode":"RU","city":"Orenburg","region":"Orenburg","latitude":"51.7227","longitude":"55.3637","timezone":"Europe/Samara"}
以下是类似服务的回报,http://freegeoip.net/json/178.44.164.112
:
{"ip":"178.44.164.112","country_code":"RU","country_name":"俄罗斯联邦","region_code":"30","region_name":"哈巴罗夫斯克","城市":"奥伦堡","邮政编码":","纬度":53.3,"经度":141.4667,"metro_code":","区号":"}
smart-ip.net 服务为我提供了一个时区(用于PHP的set_timezone)。然而,Freegeoip没有。有没有办法使用 freegeoip 的数据来获取用户的时区?
没有时区数据。 但是,您可以使用此处描述的方法之一获取纬度和经度并查找时区。