目录
1.今日0点
// 方法一:
$today = strtotime(date('Y-m-d'));
echo $today
// 方法二:
$today = strtotime('today');
echo $today
// 方法三:
$today = mktime(0, 0, 0);
echo $today
2.昨日0点
// 方法一:
$yesterday = strtotime("yesterday");
echo $yesterday;
// 方法二:
$yesterday = strtotime(date('Y-m-d', strtotime('-1 day')));
echo $yesterday;
3.上个月初
$last_month = strtotime(date('Y-m-01', strtotime('first day of last month')));
echo last_month ;
$last_month = strtotime(date('Y-m-d', strtotime('first day of last month')));
echo last_month ;
$last_month = strtotime(date('Y-m-01', strtotime('-1 month')));
echo last_month ;
$last_month = strtotime(date('Y-m-d', strtotime('-1 month')));
echo last_month ;