Home  >  Article  >  Backend Development  >  php 设置时区 Asia/Shanghai 无效,只能用 PRC

php 设置时区 Asia/Shanghai 无效,只能用 PRC

WBOY
WBOYOriginal
2016-06-06 20:38:032520browse

mac 下配置 php.ini 时使用

<code>date.timezone = Asia/Shanghai 
</code>

无效, 但是用

<code>date.timezone = PRC
</code>

却没问题。

试过加引号也不行

<code>date.timezone = "Asia/Shanghai" 
</code>

回复内容:

mac 下配置 php.ini 时使用

<code>date.timezone = Asia/Shanghai 
</code>

无效, 但是用

<code>date.timezone = PRC
</code>

却没问题。

试过加引号也不行

<code>date.timezone = "Asia/Shanghai" 
</code>

执行php -i|grep php.ini看是否改对了php.ini的位置。
看下配置是否写到php.ini的[Date]里。
执行php -i|grep date.timezone看是否配置成功。

date.timezone = "Asia/Shanghai"

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn