I want to get last month\'s date. I wrote this out:
$prevmonth = date(\'M Y\');
Which gives me the current month/year. I can\'t tell if I
Found this one wrong when the previous months is shorter than current.
echo date("Y-m-d H:i:s",strtotime("-1 month"));
Try on March the 30th and you will get 2012-03-01 instead of 2012-02...
Working out on better solution...