I need to get previous month and year, relative to current date.
However, see following example.
// Today is 2011-03-30
echo date(\'Y-m-d\', strtotim
ehh, its not a bug as one person mentioned. that is the expected behavior as the number of days in a month is often different. The easiest way to get the previous month using strtotime would probably be to use -1 month from the first of this month.
$date_string = date('Y-m', strtotime('-1 month', strtotime(date('Y-m-01'))));