Home  >  Article  >  Backend Development  >  How to get the next week and next month in PHP_PHP Tutorial

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

WBOY
WBOYOriginal
2016-07-13 10:35:33747browse

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...
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