使用php函数date_default_timezone_set设置时区的时候,为什么Etc/GMT-8实际表示的是GMT+8时区啊,里面的+、-符号怎么是反的啊 ?

解决方案 »

  1.   

    原因不懂,官方手册也有人留言说符号完的。http://www.php.net/manual/en/timezones.others.php
    The plus and minus signs (+/-) are not intuitive. For example, "Etc/GMT-10" actually refers to the timezone "(GMT+10:00) 
    Canberra,Sydney,Melbourne". [red. that is not fully true, as it is *just* GMT+10. This setting does not take care of daylight savings time for example. Please avoid using them.] "Etc/GMT+10" actually refers to the timezone GMT-10:00. These are what I have tested. I believe other + and - are also logically reversed. 
      

  2.   

    Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons. 
    http://cn.php.net/manual/en/timezones.others.php
      

  3.   

    GMT :格林威治平均时,中国位于东8区,因此时间是GMT+8
      

  4.   

    date_default_timezone_set 这个是php5.2以后的函数,主要是时间本地化GMT+8 就像楼上说的格林威治加中国东8区,就是北京时间了
      

  5.   

    个人理解,可能是:东八区 Etc/GMT-+8 以及 西八区 Etc/GMT--8。
    但是解析的时候要简化,所以:东八区 Etc/GMT-8 以及 西八区 Etc/GMT+8。