如何找出5天前的日期?

问题描述:

好吧,以下内容返回5天前的日期:

Well, the following returns what date was 5 days ago:

$days_ago = date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 5, date("Y")));

但是,我如何找到任何日期而不是今天的5天前的情况?

But, how do I find what was 5 days ago from any date, not just today?

例如:2008-12-02之前的5天是什么?

For example: What was 5 days prior to 2008-12-02?

我认为这样做的可读方式是:

I think a readable way of doing that is:

$days_ago = date('Y-m-d', strtotime('-5 days', strtotime('2008-12-02')));