php获取前一个小时的时间:
1
|
$mtime= date("Y–m–d H:i:s", strtotime("–1 hour"));
|
php获取前一天的时间:
1
|
$mtime= date("Y–m–d H:i:s", strtotime("–1 day"));
|
php获取三天前的时间:
1
|
$mtime= date("Y–m–d H:i:s", strtotime("–3 day"));
|
php获取前一个月的时间:
1
|
$mtime= date("Y–m–d H:i:s", strtotime("–1 month"));
|
php获取三个月前的时间:
1
|
$mtime= date("Y–m–d H:i:s", strtotime("–3 month"));
|
php获取前一年的时间:
1
|
$mtime= date("Y–m–d H:i:s", strtotime("–1 year"));
|