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

How to adjust server time in php_PHP tutorial

WBOY
Release: 2016-07-13 09:58:15
Original
815 people have browsed it

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