Home  >  Article  >  Backend Development  >  How to adjust server time in php_PHP tutorial

How to adjust server time in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:58:15789browse

How to adjust server time in PHP

The details are as follows:

The strftime function is mainly used to implement this function. The code is very simple, as shown below:

1

2

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

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

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

$today = strftime("%Y-%m-%d-%H",strtotime("$today -5 hour"));
http://www.bkjia.com/PHPjc/978264.htmlwww.bkjia.com
true
http: //www.bkjia.com/PHPjc/978264.html
TechArticleThe method of adjusting the server time in PHP is as follows: The strftime function is mainly used to implement this function. The code is very simple, as follows Shown: 1 2 $today = date('Y-m-d-G'); $today = strf...
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