dqbn76906 2009-04-13 10:06
浏览 265

如何通过PHP中的IP地址获取时区[重复]

This question already has an answer here:

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.

</div>
  • 写回答

10条回答 默认 最新

  • douchongbc72264 2009-04-13 10:10
    关注

    If you're running it on the local machine, you can check the configured timezone.
    http://www.php.net/manual/en/function.date-default-timezone-get.php

    There are a lot better and more reliable methods then trying to guess timezone using GeoIP. If you're feeling lucky, try: http://www.php.net/manual/en/book.geoip.php

    $region = geoip_region_by_name('www.example.com');
    $tz = geoip_time_zone_by_country_and_region($region['country_code'],
                                                $region['region']);  
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作