php市区设置中为什么Etc/GMT-8实际表示的是GMT+8

samoay 2007-11-03 10:07:43
使用php函数date_default_timezone_set设置时区的时候,为什么Etc/GMT-8实际表示的是GMT+8时区啊,里面的+、-符号怎么是反的啊 ?
...全文
2549 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
plum_mei 2010-01-06
  • 打赏
  • 举报
回复
个人理解,可能是:东八区 Etc/GMT-+8 以及 西八区 Etc/GMT--8。
但是解析的时候要简化,所以:东八区 Etc/GMT-8 以及 西八区 Etc/GMT+8。
Zijian_Zhang 2009-03-03
  • 打赏
  • 举报
回复
[Quote=引用楼主 samoay 的帖子:]
使用php函数date_default_timezone_set设置时区的时候,为什么Etc/GMT-8实际表示的是GMT+8时区啊,里面的+、-符号怎么是反的啊 ?
[/Quote]

楼主问的是什么东西???

反的原因我也不知道,希望高手。

+,-的意思是格林威治子午线的时间的相对时间,+8表示东八区。
nieliwu 2009-03-03
  • 打赏
  • 举报
回复
date_default_timezone_set 这个是php5.2以后的函数,主要是时间本地化

GMT+8 就像楼上说的格林威治加中国东8区,就是北京时间了
tottyandbaty 2009-03-03
  • 打赏
  • 举报
回复
GMT :格林威治平均时,中国位于东8区,因此时间是GMT+8
yctin 2009-03-02
  • 打赏
  • 举报
回复
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
suxiangkun 2009-03-02
  • 打赏
  • 举报
回复
哎,是啊,我也是今天才发现的!
netluck 2008-11-22
  • 打赏
  • 举报
回复
原因不懂,官方手册也有人留言说符号完的。

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.
netluck 2008-11-22
  • 打赏
  • 举报
回复
原因不懂,官方手册也有人留言怎么说符号完全方的。
unuecn 2007-11-03
  • 打赏
  • 举报
回复

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧