PHP求某一天,上周,上月等等的方式
- 上一周的时间:
date('Y-m-d',strtotime('-1 week'));
- 上周五(上周几):
dete('Y-m-d',strtotime('-1 Friday'));
- 某一天的前一天:
date('Y-m-d',strtotime('-1 day 2014-9-10 12:12:12'));
- 某一天的前一月:
date('Y-m-d',strtotime('-1 month 2014-9-10 12:12:12'));
- 上月第一天和上月最后一天:
date('Y-m-01', strtotime('-1 month')); date('Y-m-t', strtotime('-1 month'));
- 本月的第一天和最后一天:
date('Y-m-01',time()); date('Y-m-t',time());