PHP5.1以上时区设置

上一篇 / 下一篇  2006-11-01 12:34:38 / 天气: 晴朗 / 心情: 高兴

今天突然发现date('Y-m-d H:i:s')出来的时间不对,后来排除一切问题,觉得是配置的问题,打开php.ini,的确有一项:
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
以前的版本是没有的,在官方网站上文档找到相关内容,默认date.timezone为utc,在网站上有一个时区对照表:http://www.php.net/manual/en/timezones.asia.php,这个是亚洲的。竟然没有北京,有重庆、香港。我们选择香港设置后为:
[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/Hong_Kong
重启apache后,成功,问题解决。

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar