thinkphp关于时间加减几天

1.当前时间,往后退5天: date('Y-m-d H:i:s',strtotime('-1 days'));

2.有固定时间,往后面退一天或者七天,或者30天:

比如时间:$time = 2014-12-05 14:48:59

往后推一天:$time_sp=strtotime($time); //转化为时间戳

date('Y-m-d H:i:s',strtotime('-1 day ',$time_sp));

 

posted @ 2014-12-06 14:57  KOBE-Jason  阅读(1581)  评论(0编辑  收藏  举报