Home  >  Article  >  Backend Development  >  php得time zone

php得time zone

WBOY
WBOYOriginal
2016-06-23 14:36:521065browse

在php里面用 date("h:i:s")取时间的时候,是默认为GMT时间的,如果要转换到你的时间,要加入如下的代码:
putenv("TZ=US/Eastern");
echo  date("h:i:s")."\n";
?>
不过除了这个办法,应该可以在php.ini里面改一下。

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
Previous article:{php 附录}Next article:apache mod_fcgi php