php获取以前时间

来源:互联网 发布:蒲公英软件怎么用 编辑:程序博客网 时间:2024/06/08 18:38
<?php
//昨天 
print date('Y-m-d' , strtotime('-2 day')); 
//上星期 
print date('Y-m-d' , strtotime('-1 week')); 
//上个月 
print date('Y-m-d' , strtotime('-1 month')); 
//去年 
print date('Y-m-d' , strtotime('-1 year')); 
?>