//获取当前月份的前一月 function GetMonth($sign) { //得到系统的年月 $tmp_date=date("Ym"); //切割出年份 $tmp_year=substr($tmp_date,0,4); //切割出月份 $tmp_mon =substr($tmp_date,4,2); // 得到当前月份的下几月 $tmp_nextmonth=mktime(0,0,0,$tmp_mon+$sign,1,$tmp_year); // 得到当前月份的前几月 $tmp_forwardmonth=mktime(0,0,0,$tmp_mon-$sign,1,$tmp_year); return $fm_next_month=date("Ym",$tmp_forwardmonth); }
时间: 2024-11-05 15:59:21