Home > php教程 > php手册 > PHP中获取时间的下一周下个月的方法

PHP中获取时间的下一周下个月的方法

WBOY
Release: 2016-06-13 09:40:28
Original
734 people have browsed it

复制代码 代码如下:


//通常用于定制服务的时候使用,比如包月会员,包年等等

//获取当前时间过一个月的时间,以DATETIME格式显示

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

//获取当前时间过一个月的时间,以时间戳格式显示

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

//以下是年,月,周,天,时,分秒的用法

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"));

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