How to get the next week and next month in PHP_PHP Tutorial

WBOY
Release: 2016-07-13 10:35:33
Original
746 people have browsed it

Copy code The code is as follows:

//Usually used when customizing services, such as monthly membership, annual subscription, etc.

//Get the time one month after the current time, displayed in DATETIME format

date('Y-m-d H:i:s',strtotime('+1 month'))

//Get the time one month after the current time and display it in timestamp format

strtotime(date('Y-m-d H:i:s',strtotime('+1 month')))

//The following is the usage of year, month, week, day, hour, minute and second

date("Y-m-d H:i:s", strtotime(" +2 year"));
date("Y-m-d H:i:s", strtotime(" +2 month"));
date("Y-m-d H:i:s", strtotime(" +2 week"));
date( "Y-m-d H:i:s", strtotime(" +2 day"));
date("Y-m-d H:i:s", strtotime(" +2 hour"));
date("Y-m-d H:i:s", strtotime(" +2 minute"));
date("Y-m-d H:i:s", strtotime(" +2 second"));

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/743148.htmlTechArticleCopy the code code as follows: //Usually used when customizing services, such as monthly membership, annual subscription, etc. //Get the time one month after the current time, display date in DATETIME format('Y...
Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!