Home >php教程 >php手册 >1.PHP时间的配置,

1.PHP时间的配置,

WBOY
WBOYOriginal
2016-06-13 08:50:271009browse

1.PHP时间的配置,

1.打开PHP配置文件,php.ini,找到[date]下的" ;date.timezone="选项,修改为 Asia/Hong_Kong 然后重启服务器;

2.在 使用时间函数之前,添加函数 " date_default_timezone_set("Asia/Hong_Kong"); " 

3.输入本地时间函数 : 

date("Y-m-d H:i:s")
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