php得time zone

WBOY
Release: 2016-06-23 14:36:52
Original
1063 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!