I'm trying to determine how to display the following:
2012-01-01 (which is 3 months ago on the first of the month excluding the current month we're in)
My code below (which I'm certainly not married to if there is a better way), does the above
Problem is I also need to show the last day of the month, 3 months ago, taking into account not all months have 31 days??
How do you accomplish that?
$monthdate = date("Y-m");
$threemonth = strtotime ( '-3 month' , strtotime ( $monthdate ) ) ;
$threemonth = date ( 'Y-m' , $threemonth );