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

How to adjust server time in php_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 09:58:15
Original
850 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...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template