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 days ago from a particular date:
$date = new DateTime('2008-12-02'); $date->sub(new DateInterval('P5D')); echo $date->format('Y-m-d') . "\n";