I have the following code:
$now = date(\"Y-m-d H:m:s\"); $date = date(\"Y-m-d H:m:s\", strtotime(\'-24 hours\', $now));
However, now it
you can do this in many ways...
echo date('Y-m-d H:i:s',strtotime('-24 hours')); // "i" for minutes with leading zeros
OR
echo date('Y-m-d H:i:s',strtotime('last day')); // 24 hours (1 day)
Output
2013-07-17 10:07:29