Home >php教程 >php手册 >php调整服务器时间的方法

php调整服务器时间的方法

WBOY
WBOYOriginal
2016-06-13 09:08:011244browse

php调整服务器时间的方法

 具体如下:

这里主要使用strftime函数实现这一功能,代码很简单,如下所示:

1

2

$today = date('Y-m-d-G');

$today = strftime("%Y-%m-%d-%H",strtotime("$today -5 hour"));

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