Home > Backend Development > PHP Tutorial > PHP printing techniques at any time_PHP tutorial

PHP printing techniques at any time_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-15 13:34:31
Original
1165 people have browsed it

What I want to introduce to you today is about

PHP printing arbitrary time code:

  1. < ?php
  2. date_default_timezone_set
    ('Asia/Shanghai');
  3. $a = date ('Y-m-d H:i:s',
    strtotime('-1 day'));
  4. echo $a;
  5. ?>

The above PHP print any time code can print the day before Time, use a similar method to print any specific time you require. Among them - is the corresponding time in the past, and + is the corresponding time in the future.

  1. -1 year
  2. -1 month
  3. -1 day
  4. -1 hour
  5. -1 minute
  6. -1 second

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445991.htmlTechArticleWhat I want to introduce to you today is about PHP printing arbitrary time code: ?php date_default_timezone_set ('Asia/Shanghai '); $ a = date ('Y-m-dH:i:s', strtotime('-1day')); echo$a...
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