Home > Backend Development > PHP Tutorial > 帮忙写个方法,关于时间的,该怎么解决

帮忙写个方法,关于时间的,该怎么解决

WBOY
Release: 2016-06-13 10:23:47
Original
842 people have browsed it

帮忙写个方法,关于时间的
1,首先取今天的时间(年月日,比如20120517)
2,然后取出上个月(年月,比如201204)
要个无bug的方法
谢谢


------解决方案--------------------
echo "上个月:".date("Y-m-d",strtotime("last month"));

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