代码之家  ›  专栏  ›  技术社区  ›  kit phill

亚洲/仰光的PHP时区显示错误的时区

  •  1
  • kit phill  · 技术社区  · 5 年前

    我发现了 Asia/Yangon

    TZE

    但当我使用 Asia/Rangoon ,它运行我想要的正确时区。参考这个 LINK ,没有 ,只有 亚洲/仰光 亚洲/仰光 ,网站写在那里。。。

    *如果你想知道我为什么要用 ,我在这里找到的。仰光旁边有仰光。

    time

    0 回复  |  直到 5 年前
        1
  •  3
  •   Matt Johnson-Pint    5 年前

    Asia/Yangon 于2016年9月推出 TZDB 2016g ,成为当时缅甸的规范区域名称。同时, Asia/Rangoon 亚洲/仰光 亚洲/仰光 . 它们都是指在缅甸的时间。

    You can see this change in the tzdb sources here .

    亚洲/仰光 timezonedb PECL package . TZDB 2016g对应于2016-09-28发布的timezonedb 2016.7。

    PHP本身每次发布一个版本都会得到timezonedb的最新版本。因此,您的PHP安装可能非常旧,只需要更新。

        2
  •  -1
  •   Community CDub    4 年前

    缅甸仰光时区(GMT+6:30)

      $diffWithGMT=6*60*60+30*60; //converting time difference to seconds.
      $dateFormat="d-m-Y H:i:s";
      $timeAndDate=gmdate($dateFormat, time()+$diffWithGMT);//time() function returns the current time measured in the number of seconds since the Unix Epoch. 
      echo $timeAndDate; //time in Yangon
    

    自定义时区可以帮助您。

    读这个 time() change time