I\'m trying to subtract 1 month from a date.
$today = date(\'m-Y\');
This gives: 08-2016
How can I subtract a month to get 07
07
Try this,
$effectiveDate = date('2018-01'); echo 'Date'.$effectiveDate; $effectiveDate = date('m-y', strtotime($effectiveDate.'+-1 months')); echo 'Date'.$effectiveDate;