php 日期 月份解决办法

WBOY
Release: 2016-06-13 11:45:53
Original
1006 people have browsed it

php 日期 月份
php 开发 已知指定的年月份,例如为2013-12,如何获取下个月的月份?
------解决方案--------------------

<br />$first_day_of_month = "2013-12";<br /> $t = strtotime($first_day_of_month);<br /> print_r(array(<br />             date('Y-m',$t),<br />             date('Y-m',strtotime('+ 1 month',$t))<br /> ));<br />
Copy after login

------解决方案--------------------
echo date('Y-m', strtotime('2013-12-01 +1 month'));
Copy after login
2014-01

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