php获取指定时间的上月份

主要用strtotime()这个函数
php 获得前一个月的月份
date("Y-m-d",strtotime("last month"));
php获得给定时间的前一个月时间
$record="20101001";
date("Ymd",strtotime("last month",strtotime($record)));

posted @ 2020-05-31 16:13  Bashuslovakia  阅读(1419)  评论(0编辑  收藏  举报