I'm currently having a problem with a date calculation and cannot for the life in work out what is happening.
Basically I want to search for records, in the last 24hrs, 7 days, 14 days and 1 month.
I am using this code to do the date calculation
$numdays = date('Y-m-d', mktime(0,0,0,date('d'), date('m')-$date, date('Y')));
But I can't see what is wrong, maybe I've been starring at the code for a bit too long.
Any ideas?