Home  >  Article  >  Backend Development  >  php调整服务器时间的方法_php技巧

php调整服务器时间的方法_php技巧

WBOY
WBOYOriginal
2016-05-16 20:18:19989browse

本文实例讲述了php调整服务器时间的方法。分享给大家供大家参考。具体如下:

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

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

希望本文所述对大家的php程序设计有所帮助。

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