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

php调整服务器时间的方法

WBOY
Release: 2016-06-13 09:08:01
Original
1241 people have browsed it

php调整服务器时间的方法

 具体如下:

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

1

2

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

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

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template