Home > php教程 > php手册 > php automatically gets the starting time of the previous month

php automatically gets the starting time of the previous month

WBOY
Release: 2016-09-11 11:19:39
Original
2477 people have browsed it

$last_month = date('Y-m', strtotime('last month'));
$last['first'] = $last_month . '-01 00:00:00';
$last['end'] = date(‘Y-m-d H:i:s’, strtotime("$last_month +1 month -1 day +23 hours +59 minutes +59 seconds"));

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